有人知道如何或是否有可能限制在nuxt中像操作符之间那样渲染组件的位置?
我有2个变量:
requireRoute: '/dashboard',
notInRoute: '/',
变量的值可以是:
对于 requireRoute ,我正在使用方法:
const requiredRoute = this.$nuxt.$route.fullPath.startsWith(item.requireRoute);
对于 notInRoute ,我在方法中有部分工作:
const notInRoute = this.$router.currentRoute.path !== item.notInRoute;
/ dashboard / something之类的子路由会引起问题。
有人可以指出我在哪里吗?