0
我创建了我auth0配置,我现在导入我的登录页面当我尝试将vue组件连接到我的router.js文件时,会出现什么错误?
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? –