- Restore doc folder

This commit is contained in:
JeremyWuuuuu 2020-07-24 19:44:48 +08:00
parent 63a6664a06
commit b0984b0cbb
4 changed files with 10 additions and 9 deletions

View File

@ -1,6 +1,6 @@
const path = require('path');
module.exports = {
stories: ['../packages/**/*.stories.[tj]s'],
stories: ['../packages/**/doc/*.stories.[tj]s'],
presets: [path.resolve(__dirname, './custom-presets')],
};

View File

@ -1,6 +1,6 @@
import { addDecorator } from "@storybook/html";
import { createApp } from "vue";
import "../src/style/element-ui@2.13.2.css";
import { addDecorator } from '@storybook/html';
import { createApp } from 'vue';
import '../src/style/element-ui@2.13.2.css';
/**
* Wraps a story into a Vue Element
* @param {JSX.Element} template - Story templates
@ -26,8 +26,8 @@ function CustomDecorator(content) {
const { template, installer } = content();
const app = createApp(Wrapper(template));
installer(app);
const entry = document.createElement("div");
entry.className = "element-plus-previewer";
const entry = document.createElement('div');
entry.className = 'element-plus-previewer';
app.mount(entry);
return entry;
}

View File

@ -1,4 +1,4 @@
import ElButton from './index';
import ElButton from '../index';
export default {
title: 'Button',

View File

@ -27,6 +27,7 @@ NAME=$NORMALIZED_NAME
mkdir -p "$DIRNAME"
mkdir -p "$DIRNAME/src"
mkdir -p "$DIRNAME/doc"
cat <<EOF >"$DIRNAME/index.ts"
import { App } from 'vue'
@ -54,8 +55,8 @@ export default {
EOF
cat <<EOF >"$DIRNAME/index.stories.js"
import El${NAME} from './index'
cat <<EOF >"$DIRNAME/doc/index.stories.js"
import El${NAME} from '../index'
export default {
title: "${NAME}"