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); |
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 Router from 'vue-router' | |
import HelloWorld from '@/components/HelloWorld' | |
import ProfileView from '@/views/profile/Index' | |
import CreatePost from '@/views/posts/Create' | |
Vue.use(Router) | |
export default new Router({ | |
routes: [ |
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 { shallow } from 'vue-test-utils' | |
import Create from './Create' | |
describe('Create', () => { | |
it('renders a Create Post title', () => { | |
const wrapper = shallow(Create) | |
expect(wrapper.find('.title').text()).toEqual('Create Post') | |
}) | |
}) |
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> | |
<div class="title">Create Post</div> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'Create' | |
} |