Comments (2)
That's great. The switch
and case
should be optional.
Furthermore, we should clarify some edge cases.
1. If there is no switch
Only use the first <cell-slot>
to render all data in longList
. The case
property is no longer useful. Even if there are more than one <cell-slot>
, the rest will be ignored.
2. Support the default
attribute
If switch
exists and some <cell-slot>
contains the default
attribute, it should be rendered only if the type of item data doesn't match any case
.
<recycle-list for="item in longList" switch="type">
<cell-slot case="label">
<text>{{ item.foo }}</text>
</cell-slot>
<cell-slot default>
<text>{{ item.bar }}</text>
</cell-slot>
</recycle-list>
Only the first default
is valid, the rest will be ignored.
3. If switch
exists, but some <cell-slot>
has no case
or default
Those <cell-slot>
s should be ignored.
from weex-native-directive.
I think we should also throw warnings for case 1 and 3.
from weex-native-directive.
Related Issues (13)
- 所有例子WeexPlayground都不能运行 HOT 1
- Parse object literal in binding attributes or styles HOT 1
- Use more readable attributes on `<recycle-list>` HOT 1
- Support to use filters
- Manage style sheets in native render engines HOT 1
- can use section? can use section header and support sticky?
- To support scrollToElement HOT 5
- Ios 上数据源为 null 崩溃
- recycle-list里面的自定义子组件点击事件传参问题 HOT 1
- 提示:Unknown custom element: <recycle-list>,怎么解决呢? HOT 1
- TypeError: undefined is not an object (evaluating '_vm.cell.count') HOT 1
- 我这边直接0.16版测试过,发现例子展示出来的数据不对。 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weex-native-directive.