GithubHelp home page GithubHelp logo

Comments (2)

Hanks10100 avatar Hanks10100 commented on July 21, 2024

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.

yyx990803 avatar yyx990803 commented on July 21, 2024

I think we should also throw warnings for case 1 and 3.

from weex-native-directive.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.