8000 storybook: Add stories for components and directives · HelloLeoLyn/coreui-vue@810f031 · GitHub
[go: up one dir, main page]

Skip to content < 8000 link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/keyboard-shortcuts-dialog.f8fba3bd67fe74f9227b.module.css" />

Commit 810f031

Browse files
committed
storybook: Add stories for components and directives
1 parent a3c90f3 commit 810f031

37 files changed

+8720
-686
lines changed

.storybook/main.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var path = require('path')
2+
var webpack = require('webpack')
3+
4+
module.exports = {
5+
//stories: ['../src/components/**/*.stories.js'],
6+
stories: ['../stories/*.stories.js'],
7+
module: {
8+
loaders: [
9+
{
10+
test: /\.js$/,
11+
loaders: [ 'babel-loader' ],
12+
exclude: /node_modules/,
13+
include: __dirname
14+
},
15+
{
16+
test: /\.css?$/,
17+
loaders: [ 'style-loader', 'raw-loader' ],
18+
include: __dirname
19+
}
20+
]
21+
},
22+
addons: [
23+
'@storybook/addon-storysource',
24+
'@storybook/addon-knobs',
25+
],
26+
};

.storybook/preview.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//import Vue from 'vue';
2+
import { addDecorator } from '@storybook/vue';
3+
import '../node_modules/@coreui/coreui/dist/css/coreui.min.css';
4+
import CRow from '../src/components/grid/CRow'
5+
import CContainer from '../src/components/grid/CContainer'
6+
import CCol from '../src/components/grid/CCol'
7+
import CCard from '../src/components/card/CCard'
8+
//@import '~@coreui/icons/css/all.css';
9+
10+
addDecorator(() => ({
11+
components: { CCol, CCard, CContainer, CRow },
12+
template: `
13+
<CContainer fluid>
14+
<CRow>
15+
<CCol lg="12" xs="12">
16+
<CCard>
17+
<h1 class="ml-3">CoreUI</h1>
18+
</CCard>
19+
</CCol>
20+
<story/>
21+
</CRow>
22+
</CContainer>
23+
`,
24+
}));

.storybook/webpack.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
module: {
5+
rules: [
6+
{
7+
test: /\.css?$/,
8+
loaders: [ 'style-loader', 'raw-loader' ],
9+
include: path.resolve(__dirname, '../')
10+
}
11+
]
12+
}
13+
}

0 commit comments

Comments
 (0)
0