Skip to content

Commit

Permalink
[add] storybookのサンプルを増やした
Browse files Browse the repository at this point in the history
  • Loading branch information
kahirokunn committed Nov 11, 2018
1 parent b795fcd commit 12f576d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions config/storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
import { configure } from '@storybook/vue'
import '@/plugins/vuetify'

const req = require.context('../../src/stories', true, /.stories.js$/)

Expand Down
1 change: 1 addition & 0 deletions config/storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons' rel="stylesheet">
14 changes: 1 addition & 13 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
import Router from 'vue-router'
import { createRouterLayout } from 'vue-router-layout'
import requiredVerifyEmail from './middlewares/requiredVerifyEmail'
import {isTest} from '@/submodules/env'

const RouterLayout = createRouterLayout((layout) => {
return import('@/layouts/' + layout + '.vue')
})

const router = new Router({
mode: 'history',
routes: isTest() ? [] : [
{
path: '/',
component: RouterLayout,
children: require('vue-auto-routing').default,
},
],
routes: [],
})

requiredVerifyEmail(router)
Expand Down
14 changes: 14 additions & 0 deletions src/stories/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
import { storiesOf } from '@storybook/vue'
import { action } from '@storybook/addon-actions'

import '@/store/resolveTestConfiguration'
import MyButton from '../components/MyButton.vue'
import LoginForm from '@/components/containers/loginForm.vue'
import UserRegistrationForm from '@/components/containers/userRegistrationForm.vue'


storiesOf('Button', module)
.add('with text', () => ({
Expand All @@ -20,3 +24,13 @@ storiesOf('Button', module)
template: '<my-button @click="action">😀 😎 👍 💯</my-button>',
methods: { action: action('clicked') }
}))

storiesOf('Containers', module)
.add('LoginForm', () => ({
components: { LoginForm },
template: '<LoginForm/>',
}))
.add('UserRegistrationForm', () => ({
components: { UserRegistrationForm },
template: '<UserRegistrationForm/>',
}))

0 comments on commit 12f576d

Please sign in to comment.