我收到以下错误。
ERROR in [at-loader] ./ClientApp/boot.ts:7:23
TS1109: Expression expected.
ERROR in [at-loader] ./ClientApp/boot.ts:7:29
TS1134: Variable declaration expected.
ERROR in [at-loader] ./ClientApp/boot.ts:8:25
TS1109: Expression expected.
ERROR in [at-loader] ./ClientApp/boot.ts:8:31
TS1134: Variable declaration expected.
我有以下靴子。ts文件。
import './css/site.css';
import 'bootstrap';
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
const Counter = () => import('./components/counter/counter');
const FetchData = () => import('./components/fetchdata/fetchdata');
const routes = [
{ path: '/', component: require('./components/home/home.vue.html') },
{ path: '/counter', component: Counter },
{ path: '/fetchdata', component: FetchData }
];
new Vue({
el: '#app-root',
router: new VueRouter({ mode: 'history', routes: routes }),
render: h => h(require('./components/app/app.vue.html'))
});
我的tsconfig。json文件如下所示,。
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"target": "es5",
"sourceMap": true,
"skipDefaultLibCheck": true,
"strict": true,
"importHelpers": true,
"lib": [
"es5",
"es2015.promise"
],
"types": ["webpack-env"]
},
"exclude": [
"bin",
"node_modules"
]
}
我想实现以下目标。我正在使用webpack。因此,如果需要,我可以在这里发布。
https://router.vuejs.org/en/advanced/lazy-loading.html