我还是Vue Js的新手。这是我的路线代码的一部分
200 OK
我有这个奇怪的问题。当我将参数添加到路由器时,它将使用import Vue from 'vue';
import Router from 'vue-router';
import dashboard from './views/dashboard.vue';
import settings from './views/settings.vue';
const title = process.env.VUE_APP_TITLE;
Vue.use(Router);
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: [
{
path: '/',
name: 'dashboard',
component: dashboard,
},
{
path: '/payments/otherpayments',
name: 'Other Payments',
},
{
path: '/accounts/banks',
name: 'Bank Accounts',
},
{
path: '/accounts/payments',
name: 'Payments',
},
{
path: '/accounts/petty-cash',
name: 'Petty Cash',
},
{
path: '/accounts/expenses',
name: 'Expenses',
},
{
path: '/settings/:page?',
name: 'settings',
component: settings,
},
],
});
重新运行空白页,但是当我删除参数部分时,它可以正常工作。我正在使用打字稿。请问可能是什么问题。
我知道这不是键入错误,因为该错误来自SyntaxError: expected expression, got '<'