我使用Vue身份验证(
https://github.com/dgrubelic/vue-authenticate
登录
在里面
这个$认证
:/
未捕获的TypeError:无法读取未定义的属性“login”
在VueComponent。登录(login.vue?9314:70)
代理。边界fn(vue.esm.js?efeb:187)
点击时(Login.vue?8b9b:195)
at调用程序(vue.esm.js?efeb:1937)
在HTMLButtoneElement。fn_withTask。fn_withTask(vue.esm.js?efeb:1772)
代码:
<v-btn color="orange darken-1" flat @click.native="login()">Login</v-btn>
JS文件存储。js:
methods: {
login () {
this.$auth.login(this.user).then(() => {
alert('ok')
}).catch(() => {
alert('error')
})
}
}
VueJS实例:
new Vue({
el: '#app',
store,
router,
template: '<App/>',
components: { App }
})