Skip to content

Instantly share code, notes, and snippets.

Created February 22, 2019 18:26
What would you like to do?
<div class="detail">
<div v-if="hero">
<h2>{{}} Details</h2>
<div><span>id: </span>{{}}</div>
<input v-model="" placeholder="name">
<button v-on:click="goBack()">go back</button>
<button v-on:click="save()" class="save">save</button>
import router from '../../router/index'
import store from '../../store/store'
export default {
name: 'HeroDetail',
data: function() {
return {
hero: undefined
created: function () {
methods: {
getHero: function () {
this.hero = store.getHero(this.$
goBack: function () {
save: function () {
<style scoped>
label {
display: inline-block;
width: 3em;
margin: .5em 0;
color: #607D8B;
font-weight: bold;
input {
height: 2em;
font-size: 1em;
padding-left: .4em;
button {
margin-top: 20px;
font-family: Arial;
background-color: #eee;
border: none;
padding: 5px 10px;
border-radius: 4px;
cursor: pointer;
cursor: hand;
button:hover {
background-color: #cfd8dc;
button:disabled {
background-color: #eee;
color: #ccc;
cursor: auto;
.save {
margin-left: 10px;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment