当我npm run dev在项目上运行时,webpack cmd 窗口中出现错误。
这是我特别收到的代码和错误消息,与父顶级 Vue 组件相关的代码,其中包含导航栏的详细信息,具体取决于用户是否登录:
编码
<script>
// import required components
import EventBus from './components/EventBus'
import router from './router/index.js'
import jwtDecode from 'jwt-decode'
export default {
data () {
const token = localStorage.usertoken
const decoded = jwtDecode(token)
return {
first_name: '',
surname: '',
email: '',
created: ''
}
return {
auth: false
}
try {
this.login()
} catch (error) {
console.log('Not currently signed in')
}
},
methods: {
logout () {
this.first_name = ''
this.surname …Run Code Online (Sandbox Code Playgroud)