我想在authenticated
更改时自动设置this.$auth.isAuthenticated()
。可以使用computed
或watch
吗?
<script>
export default {
data: () => ({
drawer: null,
dark: true,
}),
methods: {
signOut: function(){
this.$auth.destroyToken()
this.$router.push('/')
}
},
computed: {
authenticated: function(){
return this.$auth.isAuthenticated()
}
}
}
</script>