Hanks10100 / weex-native-directive

Weex native directive design
67 stars 14 forks source link

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

Open Hanks10100 opened 6 years ago

Hanks10100 commented 6 years ago

Syntax

Change the compiler to support the new syntax.

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>.

yyx990803 commented 6 years ago

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