{"action":"created","issue":{"url":"https://api.github.com/repos/Tencent/wepy/issues/1332","repository_url":"https://api.github.com/repos/Tencent/wepy","labels_url":"https://api.github.com/repos/Tencent/wepy/issues/1332/labels{/name}","comments_url":"https://api.github.com/repos/Tencent/wepy/issues/1332/comments","events_url":"https://api.github.com/repos/Tencent/wepy/issues/1332/events","html_url":"https://github.com/Tencent/wepy/issues/1332","id":320774116,"number":1332,"title":"wepy对原生模板template的支持","user":{"login":"weiyunpeng","id":18435756,"avatar_url":"https://avatars0.githubusercontent.com/u/18435756?v=4","gravatar_id":"","url":"https://api.github.com/users/weiyunpeng","html_url":"https://github.com/weiyunpeng","followers_url":"https://api.github.com/users/weiyunpeng/followers","following_url":"https://api.github.com/users/weiyunpeng/following{/other_user}","gists_url":"https://api.github.com/users/weiyunpeng/gists{/gist_id}","starred_url":"https://api.github.com/users/weiyunpeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weiyunpeng/subscriptions","organizations_url":"https://api.github.com/users/weiyunpeng/orgs","repos_url":"https://api.github.com/users/weiyunpeng/repos","events_url":"https://api.github.com/users/weiyunpeng/events{/privacy}","received_events_url":"https://api.github.com/users/weiyunpeng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-07T11:47:02Z","updated_at":"2018-05-08T08:40:14Z","closed_at":null,"author_association":"NONE","body":"现在想基于wepy做一个小程序富文本渲染。富文本渲染需要在wxml中做大量判断，比如：\r\n\r\n\r\n```\r\n<template name=\"wxParser\">\r\n  <block wx:for=\"{{wxParserData}}\" wx:key=\"\">\r\n    <template is=\"wxParser0\" data=\"{{item}}\"/>\r\n  </block>\r\n</template>\r\n<template name=\"wxParser0\">\r\n  <block wx:if=\"{{item.node == 'element'}}\">\r\n    <block wx:if=\"{{item.tag == 'button'}}\">\r\n      <button type=\"default\" size=\"mini\" >\r\n        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\r\n          <template is=\"wxParser1\" data=\"{{item}}\"/>\r\n        </block>\r\n       </button>\r\n    </block>\r\n    <block wx:elif=\"{{item.tag == 'li' && item.parent == 'ol'}}\">\r\n      <view class=\"{{item.classStr}} wxParser-ol-li\">\r\n        <view class=\"{{item.classStr}} wxParser-ol-li-inner\">\r\n          <view class=\"{{item.classStr}} wxParser-ol-li-text\">\r\n            <view class=\"{{item.classStr}}\">{{item.order}}.</view>\r\n          </view>\r\n          <view class=\"{{item.classStr}} wxParser-ol-li-text\">\r\n            <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\r\n              <template is=\"wxParser1\" data=\"{{item}}\"/>\r\n            </block>\r\n          </view>\r\n        </view>\r\n      </view>\r\n    </block>\r\n...\r\n<template name=\"wxParser19\">\r\n  <block wx:if=\"{{item.node == 'element'}}\">\r\n    <block wx:if=\"{{item.tag == 'button'}}\">\r\n      <button type=\"default\" size=\"mini\" >\r\n        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\r\n          <template is=\"wxParser20\" data=\"{{item}}\"/>\r\n        </block>\r\n       </button>\r\n    </block>\r\n    <block wx:elif=\"{{item.tag == 'li' && item.parent == 'ol'}}\">\r\n      <view class=\"{{item.classStr}} wxParser-ol-li\">\r\n        <view class=\"{{item.classStr}} wxParser-ol-li-inner\">\r\n          <view class=\"{{item.classStr}} wxParser-ol-li-text\">\r\n            <view class=\"{{item.classStr}}\">{{item.order}}.</view>\r\n          </view>\r\n          <view class=\"{{item.classStr}} wxParser-ol-li-text\">\r\n            <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\r\n              <template is=\"wxParser20\" data=\"{{item}}\"/>\r\n            </block>\r\n          </view>\r\n        </view>\r\n      </view>\r\n    </block>\r\n```\r\n由于组件代替模板和模块，那是不是意味着要写将近20多个组件呢，这样的话还不如直接使用原生模板来实现了，可是.wpy中似乎不支持原生template模板。"},"comment":{"url":"https://api.github.com/repos/Tencent/wepy/issues/comments/387329145","html_url":"https://github.com/Tencent/wepy/issues/1332#issuecomment-387329145","issue_url":"https://api.github.com/repos/Tencent/wepy/issues/1332","id":387329145,"user":{"login":"Gcaufy","id":2182004,"avatar_url":"https://avatars1.githubusercontent.com/u/2182004?v=4","gravatar_id":"","url":"https://api.github.com/users/Gcaufy","html_url":"https://github.com/Gcaufy","followers_url":"https://api.github.com/users/Gcaufy/followers","following_url":"https://api.github.com/users/Gcaufy/following{/other_user}","gists_url":"https://api.github.com/users/Gcaufy/gists{/gist_id}","starred_url":"https://api.github.com/users/Gcaufy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gcaufy/subscriptions","organizations_url":"https://api.github.com/users/Gcaufy/orgs","repos_url":"https://api.github.com/users/Gcaufy/repos","events_url":"https://api.github.com/users/Gcaufy/events{/privacy}","received_events_url":"https://api.github.com/users/Gcaufy/received_events","type":"User","site_admin":false},"created_at":"2018-05-08T08:40:14Z","updated_at":"2018-05-08T08:40:14Z","author_association":"COLLABORATOR","body":"为什么不用rich-text"}}
{"actor":{"display_login":"Gcaufy"}}