Skip to content

Instantly share code, notes, and snippets.

@danielschmitz
Created February 14, 2018 00:04
Show Gist options
  • Save danielschmitz/e3b2de42888a4b3ce485c0f354c33609 to your computer and use it in GitHub Desktop.
Save danielschmitz/e3b2de42888a4b3ce485c0f354c33609 to your computer and use it in GitHub Desktop.
Adicioando os botões Save e Clear, ambos disparando eventos
<template>
<div>
<b-message :title="title" :closable="false">
<b-tag type="is-warning" v-show="message">{{message}}</b-tag>
<hr/>
<button class="button is-primary is-pulled-right" @click="$emit('save')" >Save</button>
<button class="button is-secondary " @click="onClearClick" >Clear</button>
</b-message>
</div>
</template>
<script>
export default {
name: 'FormBox',
props: ['title', 'message'],
data () {
return {
}
},
methods: {
onClearClick: function () {
this.$emit('clear')
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment