storybook快速新建模板
index.js模板
import ${NAME} from './${NAME}.vue';
export default {
title: 'tw-ui/${NAME}',
component: ${NAME},
argTypes: {
},
};
const actionsData = {
onClick() {
},
}
const Template = (args, {argTypes}) => ({
props: Object.keys(argTypes),
components: {${NAME}},
methods: actionsData,
template: '<${NAME} @onClick="onClick" v-bind="$props" />',
});
export const Primary = Template.bind({});
Primary.args = {
};
新建xxx.stories.js模板
import ${COM_NAME} from './${COM_NAME}'
${COM_NAME}.install = function (Vue, opts) {
Vue.component(${COM_NAME}.name, ${COM_NAME})
}
export default ${COM_NAME}