全新的奥雷利亚,并开始爱上它。但是,我对如何将外部URL包含到视图中感到困惑。例如,
<template>
<require from="css/bootstrap/bootstrap.css"></require>
<require from="fonts/font-awesome-4/css/font-awesome.css"></require>
<require from="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,400italic,700,800"></require>
<require from="http://fonts.googleapis.com/css?family=Raleway:300,200,100"></require>
<require from="css/style.css"></require>
<div class="page-host">
<router-view></router-view>
</div>
</template>我不断地发现错误:
Uncaught SyntaxError: Unexpected token ILLEGAL
Evaluating http://fonts.googleapis.com/css?family=Raleway:300,200,100.js
Error loading http://fonts.googleapis.com/css?family=Raleway:300,200,100.js我是否对外部CSS或JS文件做了错误的要求?
发布于 2015-12-09 19:31:36
require标记试图加载一个Aurelia ViewModel,而不仅仅是执行泛型文本导入。
由于Aurelia是一个单一的页面应用程序,所以可以使用传统的index.html方法从您的中加载外部CSS /字体,并且您仍然可以在其他视图上访问它们。
如果你看一下骨架应用程序,他们就是这么做的。
https://stackoverflow.com/questions/34186701
复制相似问题