mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
example: Update storybook example
This commit is contained in:
parent
fcd3f06767
commit
3806160796
@ -1,5 +1,5 @@
|
||||
import '@storybook/addon-knobs/register';
|
||||
import '@storybook/addon-actions/register';
|
||||
import '@storybook/addon-links/register';
|
||||
import '@storybook/addon-notes/register';
|
||||
import '@storybook/addon-viewport/register';
|
||||
import '@storybook/addon-knobs/register'
|
||||
import '@storybook/addon-actions/register'
|
||||
import '@storybook/addon-links/register'
|
||||
import '@storybook/addon-notes/register'
|
||||
import '@storybook/addon-viewport/register'
|
||||
|
@ -1,24 +1,21 @@
|
||||
import "vuetify/dist/vuetify.css";
|
||||
import 'vuetify/dist/vuetify.css'
|
||||
|
||||
import { configure } from "@storybook/vue";
|
||||
import Vue from "vue";
|
||||
import Vuex from "vuex";
|
||||
import Vuetify from "vuetify";
|
||||
import MyButton from "../components/Button.vue";
|
||||
import { configure } from '@storybook/vue'
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import Vuetify from 'vuetify'
|
||||
import MyButton from '../components/Button.vue'
|
||||
|
||||
Vue.use(Vuex);
|
||||
Vue.use(Vuetify);
|
||||
Vue.use(Vuex)
|
||||
Vue.use(Vuetify)
|
||||
|
||||
Vue.component("my-button", MyButton);
|
||||
Vue.component('my-button', MyButton)
|
||||
|
||||
//function loadStories() {
|
||||
// require("../src/stories");
|
||||
//}
|
||||
// Automatically import all files ending in *.stories.js
|
||||
const req = require.context('../stories', true, /.story.js$/)
|
||||
|
||||
// automatically import all files ending in *.stories.js
|
||||
const req = require.context('../stories', true, /.story.js$/);
|
||||
function loadStories() {
|
||||
req.keys().forEach((filename) => req(filename));
|
||||
req.keys().forEach((filename) => req(filename))
|
||||
}
|
||||
|
||||
configure(loadStories, module);
|
||||
configure(loadStories, module)
|
||||
|
@ -3,13 +3,13 @@ const path = require('path')
|
||||
const nxtConf = require('../nuxt.config')
|
||||
|
||||
module.exports = (sBaseConfig, configType, defaultConfig) => {
|
||||
const srcDir = `../${nxtConf.srcDir||''}`
|
||||
const rootDir = `../${nxtConf.rootDir||''}`
|
||||
|
||||
const srcDir = `../${nxtConf.srcDir||''}`
|
||||
const rootDir = `../${nxtConf.rootDir||''}`
|
||||
Object.assign(defaultConfig.resolve.alias, {
|
||||
'~~': path.resolve(__dirname, rootDir),
|
||||
'~': path.resolve(__dirname, srcDir)
|
||||
})
|
||||
Object.assign(defaultConfig.resolve.alias, {
|
||||
'~~': path.resolve(__dirname, rootDir),
|
||||
'~': path.resolve(__dirname, srcDir)
|
||||
})
|
||||
|
||||
return defaultConfig
|
||||
}
|
||||
return defaultConfig
|
||||
}
|
||||
|
@ -8,3 +8,17 @@ Deo showcasing [Storybook](https://storybook.js.org/) usage with Nuxt.js, [Vueti
|
||||
* contains storybase.js with helper classes
|
||||
* integrates most of addons
|
||||
* real life examples with Vuetify and Vue-Charts
|
||||
|
||||
### Usage
|
||||
|
||||
Start the example o [http://localhost:3000](http://localhost:3000):
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Run Storybook:
|
||||
|
||||
```bash
|
||||
npm run storybook
|
||||
```
|
||||
|
@ -20,11 +20,10 @@ export default {
|
||||
.rounded {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.wr-button {
|
||||
border: 3px solid;
|
||||
padding: 10px 20px;
|
||||
background-color: white;
|
||||
outline: none;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -66,7 +66,6 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'layout',
|
||||
|
||||
data: () => ({
|
||||
drawer: null
|
||||
}),
|
||||
|
@ -1,7 +0,0 @@
|
||||
# COMPONENTS
|
||||
|
||||
**This directory is not required, you can delete it if you don't want to use it.**
|
||||
|
||||
The components directory contains your Vue.js Components.
|
||||
|
||||
_Nuxt.js doesn't supercharge these components._
|
@ -3,14 +3,14 @@
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.VuetifyLogo {
|
||||
width: 180px;
|
||||
transform: rotateY(560deg);
|
||||
animation: turn 3.5s ease-out forwards 1s;
|
||||
}
|
||||
@keyframes turn {
|
||||
100% {
|
||||
transform: rotateY(0deg);
|
||||
}
|
||||
.VuetifyLogo {
|
||||
width: 180px;
|
||||
transform: rotateY(560deg);
|
||||
animation: turn 3.5s ease-out forwards 1s;
|
||||
}
|
||||
@keyframes turn {
|
||||
100% {
|
||||
transform: rotateY(0deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -36,20 +36,5 @@ module.exports = {
|
||||
*/
|
||||
plugins: [
|
||||
'@/plugins/vuetify'
|
||||
],
|
||||
|
||||
/*
|
||||
** Nuxt.js modules
|
||||
*/
|
||||
modules: [
|
||||
],
|
||||
|
||||
/*
|
||||
** Build configuration
|
||||
*/
|
||||
build: {
|
||||
/*
|
||||
** You can extend webpack config here
|
||||
*/
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ Vue.use(Vuetify, {
|
||||
accent: colors.grey.darken3,
|
||||
secondary: colors.amber.darken3,
|
||||
info: colors.teal.lighten1,
|
||||
warning: colors.amber,
|
||||
warning: colors.amber.base,
|
||||
error: colors.deepOrange.accent4,
|
||||
success: colors.green.accent3
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
import { storiesOf } from '@storybook/vue'
|
||||
// import { action } from '@storybook/addon-actions'
|
||||
import { linkTo } from '@storybook/addon-links'
|
||||
|
||||
import Welcome from '~/components/Welcome.vue'
|
||||
|
@ -1,5 +1,4 @@
|
||||
/* eslint-disable react/react-in-jsx-scope */
|
||||
|
||||
import Vuex from 'vuex'
|
||||
import { storiesOf } from '@storybook/vue'
|
||||
import { action } from '@storybook/addon-actions'
|
||||
@ -16,13 +15,8 @@ import {
|
||||
date,
|
||||
button
|
||||
} from '@storybook/addon-knobs/vue'
|
||||
|
||||
import MyButton from '~/components/Button.vue'
|
||||
|
||||
// storiesOf('App', module).add('App', () => ({
|
||||
// render: h => h(App),
|
||||
// }));
|
||||
|
||||
storiesOf('Features/Method for rendering Vue', module)
|
||||
.add('render', () => ({
|
||||
render: h => h('div', ['renders a div with some text in it..'])
|
||||
|
@ -12,8 +12,6 @@ import {
|
||||
object,
|
||||
button
|
||||
} from '@storybook/addon-knobs/vue'
|
||||
// import { withSmartKnobs } from "storybook-addon-smart-knobs"
|
||||
// import { withInfo } from "@storybook/addon-info"
|
||||
import centered from '@storybook/addon-centered'
|
||||
import { linkTo } from '@storybook/addon-links'
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { storiesOf } from '@storybook/vue'
|
||||
// import { linkTo } from '@storybook/addon-links'
|
||||
|
||||
import VuetifyLogo from '~/components/VuetifyLogo.vue'
|
||||
// import Layout from '~/components/Layout.vue'
|
||||
|
||||
import Centered from '@storybook/addon-centered'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user