This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from ‘vue’ | |
import { storiesOf } from ‘@storybook/vue’ | |
import Profile from ‘@/views/profile/Profile’ | |
storiesOf(‘Profile’, module) | |
.add(‘with a profile image’, () => ({ | |
components: { Profile }, | |
template: ‘<Profile />’ | |
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<img :src="profileImage"> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'Profile', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
storiesOf('Profile', module) | |
.add('with a profile image', () => ({ | |
components: { Profile }, | |
data () { | |
return { | |
image: 'https://vuejs.org/images/logo.png' | |
} | |
}, | |
template: '<profile :profile-image="image" />' | |
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
... | |
data () { | |
return { | |
result: {}, | |
loaded: false | |
} | |
}, | |
mounted () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<Profile | |
v-if=”loaded” | |
:profile-image=”result.profile.profile_image” | |
/> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<Profile | |
v-if=”loaded” | |
:profile-image=”result.profile.profile_image” | |
:profile-data=”result.profile” | |
/> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<img :src="profileImage"> | |
<div> | |
Name: {{ profileData.name }} | |
</div> | |
<div> | |
Location: {{ profileData.location }} | |
</div> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
storiesOf('Profile', module) | |
.add('with a profile image', () => ({ | |
components: { Profile }, | |
data () { | |
return { | |
image: 'https://vuejs.org/images/logo.png', | |
profileData: { | |
name: 'Lachlan', | |
location: 'Tokyo', | |
about: 'Software dev, steem and AI/ML' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<Profile | |
v-if=”loaded” | |
:profile-image=”result.profile.profile_image” | |
:profile-data=”result.profile” | |
/> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { configure } from ‘@storybook/vue’ | |
import Vue from ‘vue’ | |
function loadStories () { | |
require(‘../src/stories’) | |
} | |
configure(loadStories, module); |