Javascript 相对于ng,包括在Aurelia.js中
我希望导入到我的主html中的其他几个部分,如heder、footer,那么我可以在aurelia中这样做吗 我试过这个吼叫,但没用Javascript 相对于ng,包括在Aurelia.js中,javascript,aurelia,aurelia-templating,Javascript,Aurelia,Aurelia Templating,我希望导入到我的主html中的其他几个部分,如heder、footer,那么我可以在aurelia中这样做吗 我试过这个吼叫,但没用 <template> <import from='header.html'></import> <import from='footer.html'></import> </template> 语法是: <template> <require from='./he
<template>
<import from='header.html'></import>
<import from='footer.html'></import>
</template>
语法是:
<template>
<require from='./header'></require> <!-- this "requires" the component -->
<require from='./footer'></require>
<header></header> <!-- this "uses" the component -->
<!-- content -->
<footer></footer>
</template>
如果组件由视图和视图模型对组成,则只需使用
。如果它仅由一个视图组成,则必须在末尾添加“.html”,如下图所示,语法如下:
<template>
<require from='./header'></require> <!-- this "requires" the component -->
<require from='./footer'></require>
<header></header> <!-- this "uses" the component -->
<!-- content -->
<footer></footer>
</template>
如果组件由视图和视图模型对组成,则只需使用
。如果它只由一个视图组成,那么您必须将“.html”放在末尾,就像这样