{{% {{#if($env.url.query.wh_block || $env.url.query.wh_chunk)}} %}} {{#if(modules.length)}} //abs ==================这里是模块信息============================== if(typeof(SCENE_DATA) === "undefined"){ SCENE_DATA = {}; } {{#each(modules)}} {{#if(sceneData)}} SCENE_DATA['{{id}}'] = '{{{sceneData}}}'; {{/if}} {{/each}} PAGE_DATA = {{{modsJson}}}; {{/if}} {{% {{else}} %}} {{#each(JSON.parse(modsJson))}} {{{this.sourceCode}}} {{/each}} define('__page_data', function(require, exports, module) { module.exports = { page:{ /* pageId:, theme:, charset:, title:'', spma:'', spmb:''*/ }, modules:{{{modsJson}}} } }); define('npm/@ali/pi-weex/index', function(require, exports, module) { module.exports = { data: function() { return { modsdata: [], pageData: {} }; }, init: function() { console.log('init'); }, created: function() { console.log('created'); }, ready: function() { console.log('ready'); }, methods: {} }; module.exports.style = {}; module.exports.template = { 'type': 'div', 'style': { }, 'events': { }, children: [{ 'type': 'list', 'children': [ { 'type': (function() { return 'cell'; }), 'repeat': function() { return this.modsdata; }, 'append': 'tree', 'children': [ { 'id': (function() { return this.moduleId || ''; }), 'type': (function() { return this.name; }), 'attr': { 'id': function() { return this.moduleId || ''; }, 'index': function() { return this.index || 0; }, 'name': function() { return this.name || ''; }, 'data': function() { return this.data || {}; }, 'attrs': function() { return this.attrs || {}; } } } ] } ] }] }; }); define('init', function(require, exports, module) { var pagedata = require('__page_data'); module.exports = { } module.exports.template = { "type": "npm/@ali/pi-weex/index", "attr": { "modsdata": function() { return pagedata.modules || '' }, "pageData": function() { return pagedata.page || '' } } }; }) bootstrap('init') {{% {{/if}} %}}