Closed ibrahim-990 closed 1 year ago
https://github.com/hannoeru/vite-plugin-pages#sfc-custom-block-for-route-data
i cant access isEdit from script in
@jbaubree
Can you share a repo with repro ?
I'm work on vuexy dashboard I'm use like this
@jbaubree
@jbaubree can you help me please ?
I don't understand why you wan't to use route for this. You have isEdit in script and you can build your input types and submit button depending on isEdit or not. What do you want to do with action in route?
You can use route meta to define if you need specific role or auth to show this page for example:
// yourPage.vue
<route lang="yaml">
meta:
needAuth: true
</route>
// router.ts
router.beforeEach(({ meta }) => {
const userStore = useUserStore()
if (meta.needAuth && !userStore.isAuthenticated))
return { name: 'sign-in' }
return true
})
ok this work, but i have on form page and this form has meta permission edit or add and i want to check like this to add permission ${isEdit.value ? 'can_update' : 'can_view'} how i can do this?
your edit or add state does not need to be in route meta, or i do not understand why.
Edit: you need to move this issue to discussion
Describe the bug
i cant access isEdit from in route with vuejs. i Get value like this permission: {parent: 'roles', action: "${isEdit.value ? 'can_update' : 'can_view'}"}
Reproduction
no repo
System Info
Used Package Manager
npm
Validations