Skip to content

Instantly share code, notes, and snippets.

@onefriendaday
Created July 11, 2018 08:34
Show Gist options
  • Save onefriendaday/90d226e4cd796dcb7468872c48b77c90 to your computer and use it in GitHub Desktop.
Save onefriendaday/90d226e4cd796dcb7468872c48b77c90 to your computer and use it in GitHub Desktop.
Demonstrates usage of sb-asset-selector
const Fieldtype = {
mixins: [window.Storyblok.plugin],
template: `<div>
<sb-asset-selector :uid="uid" field="image"></sb-asset-selector>
<input type="text" class="uk-margin-top uk-width-1-1" v-model="model.image" />
</div>`,
methods: {
initWith() {
return {
plugin: 'example_plugin',
example: 'Hello world!',
image: ''
}
},
pluginCreated() {
console.log('plugin:created')
}
},
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