improve loader organization syntax with script setup #731
Closed
Hebilicious
started this conversation in
Ideas
Replies: 2 comments
-
|
This should already work with the experimental autoExportsDataLoaders: VueRouter({
extensions: ['.page.vue', '.vue'],
importMode: 'async',
logs: false,
// getRouteName: getPascalCaseRouteName,
experimental: {
autoExportsDataLoaders: ['src/loaders/**/*', '@/loaders/**/*'],
paramParsers: false,
},
})Let me know if it works well or not for you! For non page components, you don't need to export, so it should be already working though |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Amazing ! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the organization section of the docs, we can see the following pattern :
This is not the most ergonomic, so it would be neat if we could support this as well, and make it the default syntax :
There might be multiple ways to make this work,ie it could be similar to vue-macros, where it would compile to the first snippet.
For people who like and use auto-import, that means that this would work too. :
Regarding non-page components, the more natural syntax of importing from a dedicated loader directory would work.
While this is hiding some of the complexity, it makes writing the code more natural.
What do you think ?
Beta Was this translation helpful? Give feedback.
All reactions