This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const StoryblokClient = require('storyblok-js-client') | |
// Insert your oauth token and folder id | |
const Storyblok = new StoryblokClient({ | |
oauthToken: 'YOUR_OAUTH_TOKEN' | |
}) | |
const fieldToDelete = 'my_field' | |
const componentName = 'page' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div> | |
<select v-model="model.value"> | |
<option :key="tag.name" :value="tag.name" v-for="tag in tags">{{tag.name}}</option> | |
</select> | |
</div>`, | |
data() { | |
return { | |
tags: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div class="image__wrap"> | |
<div class="uk-text-center uk-margin-small-bottom" v-if="validImage"> | |
<img :src="model.image" class="image" /> | |
</div> | |
<div class="uk-margin-small-bottom"> | |
<sb-asset-selector :uid="uid" field="image"> | |
</sb-asset-selector> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div> | |
<ul class="uk-list"> | |
<li :key="item.id" v-for="item in tree"> | |
<tree :category="item" :sub-categories="allCats" :categories.sync="model.categories"></tree> | |
</li> | |
</ul> | |
</div>`, | |
components: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div> | |
<sb-asset-selector :uid="uid" field="image"> | |
</sb-asset-selector> | |
<textarea v-model="model.content" id="mytextarea"> | |
</textarea> | |
</div>`, | |
methods: { | |
initWith() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div> | |
<input class="uk-width-1-1" @input="validate" v-model="proxyModel.example" /> | |
<div v-if="!valid">Please fill out this field</div> | |
</div>`, | |
data() { | |
return { | |
proxyModel: {}, | |
valid: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div> | |
<div class="uk-form-row"> | |
Category | |
<select v-model="model.category" class="uk-width-1-1"> | |
<option></option> | |
<option :key="cat.item.id" :value="cat.item" v-for="cat in tree">{{ cat.item.name }}</option> | |
</select> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div> | |
<div class="uk-form-row"> | |
Category | |
<select v-model="model.category" class="uk-width-1-1"> | |
<option></option> | |
<option :key="item.id" :value="item.id" v-for="item in categories">{{ item.name }}</option> | |
</select> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div class="List"> | |
<ol class="uk-list uk-margin-bottom-remove"> | |
<li | |
v-for="(item, index) in model.items" | |
:key="index" | |
class="uk-flex uk-flex-middle uk-margin-small-bottom"> | |
<input | |
v-model="model.items[index]" |