mip-project / mip

MIT License
11 stars 1 forks source link

MIP 组件模板的最终方案是? #14

Closed easonyq closed 6 years ago

easonyq commented 6 years ago

从目前的例子 example/simple 来看,组件的模板是定义在当前使用页面中,如

<script type="text/x-template" id="mip-tree-template">
    <div></div>
</script>

我不确定这是不是最终方案?

如果是,那么 mip-router 在切换页面时也需要将这一段脚本视作组件的一部分,同 mip-tree.js 一同被加载(我暂时就是这么做的);如果不是,例如融合到 mip-tree.js 内部或者其他方案,请周知一下。

我认为目前定义在用户页面上:

easonyq commented 6 years ago

组建采用 customElement 之后,模板也被包裹到组建 js 中了,因此用户模板上就没有了。