Skip to content

Instantly share code, notes, and snippets.

@onefriendaday
Created May 18, 2020 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onefriendaday/ea3163535bc3179a7f36053ab25af387 to your computer and use it in GitHub Desktop.
Save onefriendaday/ea3163535bc3179a7f36053ab25af387 to your computer and use it in GitHub Desktop.
Example of asset selector
const Fieldtype = {
mixins: [window.Storyblok.plugin],
template: `<div>
<sb-asset-selector :uid="uid" field="example">
</sb-asset-selector>
{{model.example}}
</div>`,
methods: {
initWith() {
return {
plugin: 'example_plugin',
example: ''
}
},
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