Dan*_*lci 2 vue.js vuejs2 nuxt.js
登录后,我在 store 和 localStorage 内设置了变量"authenticated" = true。
如果authenticated==true并显示不同的菜单元素,我如何检查每个页面?
(我用的是ssr)
谢谢
authenticated在登录时设置 Vuex 状态。在需要该状态的组件中设置计算变量。
computed() {
authenticated () => { return this.$store.state.authenticated }
}
在您的模板中使用它<v-if>。
祝你好运!
| 归档时间: |
|
| 查看次数: |
4692 次 |
| 最近记录: |