Skip to content

Instantly share code, notes, and snippets.

@salmanyaqoob
Created January 28, 2021 08:38
Show Gist options
  • Select an option

  • Save salmanyaqoob/f18bfe87ae83d41ab516674256bf00fa to your computer and use it in GitHub Desktop.

Select an option

Save salmanyaqoob/f18bfe87ae83d41ab516674256bf00fa to your computer and use it in GitHub Desktop.
Array screen UI
<stack class="stack">
<image src='/common/background.png' class="background"></image>
<div class="container" onswipe="touchMove">
<text>
Arrays
</text>
<!-- div loop rendering -->
<!--By default, $item indicates the element in the array, and $idx indicates the index of the element in the array.-->
<div for="{{arrayData}}" tid="id" class="containerArray">
<text>{{$idx}}.{{$item.name}}
</text>
</div>
<!-- Define the name for an element variable. -->
<div for="{{value in arrayData}}" tid="id" class="containerArray">
<text>{{$idx}}.{{value.name}}
</text>
</div>
<!-- Define an element variable and its index name. -->
<div for="{{(index, value) in arrayData}}" tid="id" class="containerArray">
<text>{{index}}.{{value.name}}
</text>
</div>
</div>
</stack>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment