简体   繁体   English

相对于Aurelia.js中的ng-include

[英]relative to ng-include in Aurelia.js

I want import to my main html few other parts like heder, footer, so can I do this in aurelia? 我想导入到我的主要html其他几个部分,如heder,footer,所以我可以在aurelia中这样做吗?

I tried this bellow and did not work 我尝试过此波纹管,但没有用

<template>
 <import from='header.html'></import>
 <import from='footer.html'></import>
</template>

The syntax is: 语法为:

<template>
  <require from='./header'></require> <!-- this "requires" the component -->
  <require from='./footer'></require>

  <header></header> <!-- this "uses" the component -->
  <!-- content -->
  <footer></footer>
</template>

If your component is composed of a view and view-model pair, you just have to use <require from="./header"></require> . 如果您的组件由视图和视图模型对组成,则只需使用<require from="./header"></require> If it is composed of only a view, then you have to put '.html' at the end, like this <require from="./header.html"></require> 如果它仅由一个视图组成,则必须在末尾添加“ .html”,例如<require from="./header.html"></require>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM