📓 Storybook 的 Vuetify 🐉 附加组件

在 Github 上查看

⚠️⚠️ 此仓库不再维护 ⚠️⚠️

查看 https://github.com/mikinovation/storybook-addon-vuetify3

@socheatsok78/storybook-addon-vuetify

📓 Storybook 的 Vuetify 🐉 附加组件

@npm license

安装

yarn add -D @socheatsok78/storybook-addon-vuetify

使用

@socheatsok78/storybook-addon-vuetify 附加组件添加到 .storybook/main.js

module.exports = {
  addons: [
    '@socheatsok78/storybook-addon-vuetify'
  ]
}

vuetify 装饰器添加到 .storybook/preview.js

import { withVuetify } from '@socheatsok78/storybook-addon-vuetify/dist/decorators'

export const decorators = [
  withVuetify
]

你可以添加 withThemeProvider 来使用 vuetify 主题设置。但请确保添加 globalTypes,如所示。

import { withVuetify, withThemeProvider } from '@socheatsok78/storybook-addon-vuetify/dist/decorators'

export const globalTypes = {
  theme: {
    name: 'Theme',
    description: 'Global theme for components',
    defaultValue: 'light',
    toolbar: {
      icon: 'circlehollow',
      items: ['light', 'dark']
    }
  }
}

export const decorators = [
  withThemeProvider,
  withVuetify
]

许可证

根据 MIT 许可证 授权。