标签:style class blog code ext color
groot.view("myview", function (vm, ve) { ve.loada = function () { require("./app/pagea.js").loadpage($("#app"), "myapp") } ve.loadb = function () { require("./app/pageb.js").loadpage($("#app"), "myapp") } })
exports.loadpage = function (element, id) { var moudle = groot.view(id, function (vm, ve) { ve.hello = function () { alert("bbb"); } }) var html = require("./pageb.html!text"); element.html(groot.createElement(html, id)); groot.sweep(moudle, element); }
请上官网,下载单页面引用的demo
标签:style class blog code ext color
原文地址:http://www.cnblogs.com/blowfish/p/3785527.html