weex-native-directive icon indicating copy to clipboard operation
weex-native-directive copied to clipboard

Use more readable attributes on `<recycle-list>`

Open Hanks10100 opened this issue 7 years ago • 1 comments

Syntax

Change the compiler to support the new syntax.

  • Use for instead of the list-data, alias and index.
  • Use switch instead of the template-key.
  • Use case instead of the template-type.

Examples

Before:

<recycle-list :list-data="longList" template-key="cellType" alias="item" index="i">
  <cell-slot template-type="A"> ... </cell-slot>
  <cell-slot template-type="B"> ... </cell-slot>
</recycle-list>

After:

<recycle-list for="(item, i) in longList" switch="cellType">
  <cell-slot case="A"> ... </cell-slot>
  <cell-slot case="B"> ... </cell-slot>
</recycle-list>

The data of longList still should be binding with the <recycle-list>.

Hanks10100 avatar Dec 18 '17 12:12 Hanks10100

done in https://github.com/vuejs/vue/commit/7cc0b559e9e57fcb3baeae5d8d4c8964aa335b5e

yyx990803 avatar Dec 19 '17 21:12 yyx990803