Allow users to enhance the Vue app instance in vue 3
See original GitHub issueThis is a follow up to #125
I will need to add another option: enhancePreviewApp
.
Here is how you will use it:
// styleguide.config.js
import { defineConfig } from 'vue-styleguidist'
export default defineConfig({
enhancePreviewApp: 'styleguide/enhanceApp.js' // path of the file you want to define directives in
})
// styleguide/enhanceApp.js
import directive from '@/directives'
import { defineEnhanceApp } from 'vue-styleguidist'
export default defineEnhanceApp((app) => {
app.directive('directive', directive)
})
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Creating a Vue Application - Vue.js
Every Vue application starts by creating a new application instance with the createApp function: js import { createApp } from 'vue' const app...
Read more >The Benefits of the New Vue 3 App Initialization Code
The new architecture gives us the possibility to have two or more isolated Vue instances that do not share any features by default,...
Read more >Refactoring your Vue 2 apps to Vue 3 - LogRocket Blog
Now, all the dependencies in the project have been upgraded and are ready to be used. We just need to enable them by...
Read more >Vue 3 Tutorial (for Vue 2 Users) - Vue.js Developers
Wondering what the key features and changes of Vue 3 are? In this article, I'll highlight them with a walkthrough of a simple...
Read more >The Complete Guide to Provide/Inject API in Vue 3: Part 1
Get started building plug-ins using Vue 3's Provide/Inject API. Learn about Props, Prop Drilling and how to solve the side effects of Prop ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@didagu You can skip the function altogether. It was meant to help write the code with the proper types.
It is returning exactly its params without modification.
@elevatebart I can’t seem to get this feature to work. It prints out the error:
It’s just a normal js file. We already use the
renderRootJsx
andrequire
options for other files in the same folder and that works as expected, just this one doesn’t work.The error seems to be linked to actually importing
defineEnhanceApp
, because it goes away if I remove it without changing anything else and it also comes back if I importdefineEnhanceApp
from another file (like require.ts) even if I don’t actually use it.