【发布时间】:2017-10-26 17:46:12
【问题描述】:
我已经创建了我的 auth0 配置,现在我正在导入我的登录页面
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
// create import statements
import login from './containers/login'
import home from './containers/home'
import dashboard from './containers/dashboard'
import projects from './containers/projects'
import auth from './auth'
// application routes
const routes = [
// each path will render each component when it experiences an event
{ path: '/', component: home },
{ path: '/dashboard', component: dashboard },
{ path: '/projects', component: projects }
]
// export router instance
/* Using mode : 'history '
This removes the hash from the url and gives
the app a cleaner url string
*/
export default new Router({
mode: 'history',
routes,
/* use link activeClass to indicate what
class to add to the navigation to make the menu item active
*/
linkActiveClass: 'is-active'
})
我遇到了这个错误
Syntax Error: import is a reserved word (32:2)
在添加 login.vue 和 auth.js 之前,代码是可以运行的,但是当我输入它们时,它会返回上述错误。
我正在使用 vue.js 框架,并使用 Auth0 来保证安全性。
【问题讨论】:
-
不使用的时候为什么要导入auth.js?