Code Monkey home page Code Monkey logo

wxml-parser's People

Contributors

seanlong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wxml-parser's Issues

ReferenceError: item is not defined

eferenceError: item is not defined
at eval (eval at mustacheEvaluate (wxml-parser.js:191), :1:658)
at eval (eval at mustacheEvaluate (wxml-parser.js:191), :1:669)
at mustacheEvaluate (wxml-parser.js:191)
at stringEvaluate (wxml-parser.js:175)
at parseTextNode (wxml-parser.js:96)
at XML2DataTree (wxml-parser.js:55)
at XML2DataTree (wxml-parser.js:88)
at XML2DataTree (wxml-parser.js:88)
at XML2DataTree (wxml-parser.js:88)
at XML2DataTree (wxml-parser.js:88)

      Page({
          data: {
            list: [
              {
                id: 'view',
                name: '视图容器',
                open: false,
                pages: ['view', 'scroll-view', 'swiper']
              }, {
                id: 'content',
                name: '基础内容',
                open: false,
                pages: ['text', 'icon', 'progress']
              }, {
                id: 'form',
                name: '表单组件',
                open: false,
                pages: ['button', 'checkbox', 'form', 'input', 'label', 'picker', 'radio', 'slider', 'switch']
              }, {
                id: 'feedback',
                name: '操作反馈',
                open: false,
                pages: ['action-sheet', 'modal', 'toast', 'loading']
              }, {
                id: 'nav',
                name: '导航',
                open: false,
                pages: ['navigator']
              }, {
                id: 'media',
                name: '媒体组件',
                open: false,
                pages: ['image', 'audio', 'video']
              }, {
                id: 'map',
                name: '地图',
                pages: ['map']
              }, {
                id: 'canvas',
                name: '画布',
                pages: ['canvas']
              }
            ]
          },
          widgetsToggle: function (e) {
            var id = e.currentTarget.id, list = this.data.list;
            for (var i = 0, len = list.length; i < len; ++i) {
              if (list[i].id == id) {
                list[i].open = !list[i].open;
              } else {
                list[i].open = false;
              }
            }
            this.setData({
              list: list
            });
          }
        })
<view class="index">
    <view class="head">
        <view class="title">小程序组件</view>
        <view class="desc">这里就当前已支持的组件进行演示</view>
    </view>

    <view class="body">
        <view class="widgets">
            <block wx:for-items="{{list}}">
                <view class="widgets__item">
                    <view id="{{item.id}}" class="widgets__info {{item.open ? 'widgets__info_show' : ''}}" bindtap="widgetsToggle">
                        <text class="widgets__info-name">{{item.name}}</text>
                        <image class="widgets__info-img" src="/image/arrowright.png" mode="aspectFill" />
                    </view>
                    <view class="widgets__list {{item.open ? 'widgets__list_show' : ''}}">
                        <block wx:for-items="{{item.pages}}" wx:for-item="page">
                            <navigator url="component-pages/{{page}}/{{page}}" class="widget">
                                <text class="widget__name">{{page}}</text>
                                <image class="widget__arrow" src="/image/arrowright.png" mode="aspectFill" />
                                <view class="widget__line {{index == 0 ? 'widget__line_first' : ''}}"></view>
                            </navigator>
                        </block>
                    </view>
                </view>
            </block>
        </view>
    </view>
</view>

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.