mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat: support re-export story from vue
This commit is contained in:
committed by
jeremywu
parent
fcba294463
commit
cb0b012fac
@@ -13,6 +13,20 @@ function webpack(config) {
|
||||
loader: require.resolve('vue-loader'),
|
||||
options: {},
|
||||
},
|
||||
{
|
||||
test: /\.stories\.ts$/,
|
||||
use: [
|
||||
{
|
||||
loader: require.resolve('./export-loader')
|
||||
},
|
||||
{
|
||||
loader: require.resolve('ts-loader'),
|
||||
options: {
|
||||
transpileOnly: true,
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.(ts|tsx)$/,
|
||||
use: [
|
||||
|
||||
7
.storybook/export-loader.js
Normal file
7
.storybook/export-loader.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = function (content) {
|
||||
return content.replace(
|
||||
/export ?{\s* default as (.+?)}(.+)/g,`
|
||||
import _$1 $2
|
||||
export const $1 = () => _$1
|
||||
`)
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
import Basic from './basic.vue'
|
||||
export { default as BasicUsage} from './basic.vue'
|
||||
|
||||
export default {
|
||||
title: "Badge",
|
||||
}
|
||||
|
||||
export const BasicUsage = () => Basic
|
||||
|
||||
Reference in New Issue
Block a user