Skip to content

Instantly share code, notes, and snippets.

@Bensigo
Last active February 18, 2020 06:23
Show Gist options
  • Save Bensigo/e4dc5a47cb4a6600588179a901986b4f to your computer and use it in GitHub Desktop.
Save Bensigo/e4dc5a47cb4a6600588179a901986b4f to your computer and use it in GitHub Desktop.
<template>
<div>
<div class="demo-wrapper">
<cb-structured section="demo-fields-button" :schema="schema">
<template v-slot:content="props" >
<button :class="props.content.myButton.style" @click="clicked">{{props.content.myButton.label}}</button>
<raw-output :content="props"></raw-output>
</template>
</cb-structured>
</div>
</div>
</template>
<script>
import mixin from './mixin'
export default {
mixins: [mixin],
data() {
return {
schema: {
fields: [
{
id: 'myButton',
type: 'button',
label: 'Example Button'
}
]
}
}
},
methods: {
clicked() {
alert("clicked");
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment