Created
July 4, 2018 19:45
-
-
Save paltman/998ccf18082c669f51f331a1098090ee to your computer and use it in GitHub Desktop.
This file contains hidden or 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 class="setup-form"> | |
<b-form-group description="The title of your page" label="Page Title" label-for="title"> | |
<b-form-input id="title" v-model.trim="title"></b-form-input> | |
</b-form-group> | |
<div class="mt-5"> | |
<b-button variant="primary" :block="true" @click="onUpdate">Update</b-button> | |
</div> | |
</div> | |
</template> | |
<script> | |
export default { | |
data () { | |
return { | |
_title: '' | |
} | |
}, | |
methods: { | |
onUpdate () { | |
console.log(this._title); // dispatch action to push title back to API here | |
} | |
}, | |
computed: { | |
title: { | |
get () { | |
if (this._title) { | |
return this._title; | |
} | |
return this.$store.getters.title | |
}, | |
set (value) { | |
this._title = value; | |
} | |
} | |
}, | |
name: 'setup-tab-form' | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment