#How to have a decorator include a Vue component as root?
33 messages Β· Page 1 of 1 (latest)
Yes @fossil ingot it should work with CSF3 , using StroyObj ,
ahaaaa, thank you! cool trick π
import { VApp } from 'vuetify/components';
export const decorators: Decorator[] = [
(story) => ({
components: { VApp, story },
template: '<v-app><story/></v-app>',
}),
];
@fossil ingot If you want to use different themes, this recipe can help π
ahh nice! I'll check this out later, thanks for sharing that!
maybe it'll also fix the issue where Storybook initially reloads several times upon start, and reloads when you switch to different stories? (Vuetify components being re-optimized in Vite)
I haven't noticed multiple reloads in my example π
hmmm. would you happen to have any spare time to help me out with this? I can pay you for your time
although, lemme take a stab at this after I read your article
it might be something dead simple
Not today unfortunately but perhaps tomorrow if you're still having problems
oh yeah, not today. it's not urgent.. BUT important for us to get this working smoothly. I'm gonna dig into your article right now πͺ
one initial thought: it'd be nice to see the code behind this:
import { registerPlugins } from '../src/plugins';
there are so many ways to configure & set up Vuetify. it'd be good to see how you set yours up
Fair enough π let me get that for you
ok, so components will be auto imported then. no forced loading via createVuetify components property
I'm only explicitly loading the Vuetify labs components. all else is auto imported upon use.
export default createVuetify({
blueprint: _merge(md3, md3Custom),
components: labs,
icons: {
defaultSet: 'mdi',
aliases: {
...aliases,
...iconOverrides,
},
sets: { fa, mdi },
},
theme: {
defaultTheme: 'light',
themes: {
dark,
light,
},
variations: {
colors: ['primary', 'info'],
lighten: 9,
darken: 9,
},
},
});
Right, I didn't get too into the weeds with tweaking vuetify itself
ok, actually this is working a bit better now! it seems to load Vuetify components less often. but.. towards the end of this video, you can see that it gets stuck on one and I have to reload to get it to work.
and every time I fire up Storybook, there's always that initial error
it's not a total showstopper, but just an annoyance. could also just be that this is due to 7.0 still being beta π
lemme update all the related packages
I see beta 60 is out
whew.. btw is there a better way than this? π
pnpm i -D @storybook/addon-actions@next @storybook
/addon-essentials@next @storybook/addon-interactions@next @storybook/addon-links
@next @storybook/blocks@next @storybook/vue3@next @storybook/vue3-vite@next
unfortunately, pnpm up -i --latest doesn't pick up the next beta versions
shoot. still get the red error of death upon startup.
run npx sb@next upgrade --prerelease
and when I navigate between stories, it takes a while to load each one.
2:05:46 PM [vite] β¨ new dependencies optimized: vuetify, vuetify/labs/components, vuetify/blueprints, vuetify/iconsets/fa, vuetify/iconsets/mdi, ...and 2 more
2:05:46 PM [vite] β¨ optimized dependencies changed. reloading
2:05:56 PM [vite] β¨ new dependencies optimized: vuetify/lib/components/VCard/index.mjs, vuetify/lib/components/VOverlay/index.mjs, vuetify/lib/components/VProgressLinear/index.mjs
2:05:56 PM [vite] β¨ optimized dependencies changed. reloading
2:06:17 PM [vite] β¨ new dependencies optimized: vuetify/lib/components/VIcon/index.mjs, vuetify/lib/components/VSwitch/index.mjs, vuetify/lib/components/VList/index.mjs, vuetify/lib/components/VMenu/index.mjs, vuetify/lib/components/VTabs/index.mjs, ...and 4 more
2:06:17 PM [vite] β¨ optimized dependencies changed. reloading
2:06:41 PM [vite] β¨ new dependencies optimized: vuetify/lib/components/VBtn/index.mjs, vuetify/lib/components/VDivider/index.mjs, vuetify/lib/components/VDialog/index.mjs, vuetify/lib/components/VGrid/index.mjs
2:06:41 PM [vite] β¨ optimized dependencies changed. reloading
Reason: Mass emoji
Interesting! I won't if this is a vite thing??? @half isle has this come up before?
still seeing reloads all over the place as I navigate through my stories
so.. the Vuetify lead guy said to try importing all components instead of relying on auto import.
import 'vuetify/styles'
import { createVuetify } from 'vueify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
export default createVuetify({
components,
directives,
})
I tried that, it didn't help