使用ES6模板字符串加载器导入html文件。
- 论坛
- 使用ES6模板字符串加载器导入html文件。
10 浏览
使用ES6模板字符串加载器导入html文件。
我想使用es6模板字符串加载器将我的模板导入到我的js中。在我的情况下,唯一的区别是我不想包含css,只需要html。我的代码如下:
import app from '../../bootstrap.js'; import template from './header.html'; app.component('siteHeader', { template });
我的错误是Uncaught SyntaxError: Unexpected token export
。