入门
链接
要求
- Vue 3.0+
- Tailwind CSS
- Storybook
安装包
npm install storybook-tailwind-foundations
修改 ./storybook/main.js
const path = require('path');
const tailwindConfigPath = path.join(__dirname, '../tailwind.config.js'); // or your own config file
require('storybook-tailwind-foundations/initialize.js')
.default(tailwindConfigPath);
module.exports = {
// ...
stories: [
// ...
'../node_modules/storybook-tailwind-foundations/**/*.stories.js'
],
}
启动 Storybook
如果对 Tailwind 配置进行任何更改,则需要重新启动 Storybook 才能看到更改。现在您可以启动 Storybook,侧边栏中应该会出现“基础”部分。