Skip to content

Instantly share code, notes, and snippets.

@onefriendaday
Created February 12, 2019 14:11
Show Gist options
  • Save onefriendaday/7cfc2719671000123359900667c1f198 to your computer and use it in GitHub Desktop.
Save onefriendaday/7cfc2719671000123359900667c1f198 to your computer and use it in GitHub Desktop.
const Fieldtype = {
mixins: [window.Storyblok.plugin],
template: `<div class="uk-flex">
<input class="uk-margin-right" v-model="model.color" type="color" />
<input class="uk-width-1-1" v-model="model.color" /></div>`,
methods: {
initWith() {
return {
plugin: 'ef-native-color-picker',
color: ''
}
}
},
events: {
'plugin:created': function() {
console.log('plugin:created')
},
'plugin:destroyed': function() {
console.log('plugin:destroyed')
}
},
watch: {
'model': {
handler: function (value) {
this.$emit('changed-model', value);
},
deep: true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment