Open durbanitas opened 7 months ago
I need help using this line mentioned in the documentation on how to change a layout dynamically:
export default { layout: (ctx) => ctx.$device.isMobile ? 'mobile' : 'default' }
<script setup> definePageMeta({ layout: (ctx) => (ctx.$device.isMobile ? 'mobile' : 'default'), }); </script> <template> <main> ... </main> </template>
vite_ssr_import_6.default[props.name] is not a function Invalid layout (ctx) => (ctx.$device.isMobile ? 'mobile' : 'default') selected. [Vue warn]: Invalid prop: type check failed for prop "name". Expected String | Boolean, got Function
vite_ssr_import_6.default[props.name] is not a function
Invalid layout (ctx) => (ctx.$device.isMobile ? 'mobile' : 'default') selected. [Vue warn]: Invalid prop: type check failed for prop "name". Expected String | Boolean, got Function
(ctx) => (ctx.$device.isMobile ? 'mobile' : 'default')
Where do I place this? My guess is initalizing as a plugin or to create a middleware...
default.vue
mobile.vue
I need help using this line mentioned in the documentation on how to change a layout dynamically:
Tried
index.vue
Error
Question
Where do I place this? My guess is initalizing as a plugin or to create a middleware...
Goal
default.vue
andmobile.vue