Update usage of new component
This commit is contained in:
parent
5b548e9d6a
commit
bc0918876b
|
|
@ -5,7 +5,9 @@
|
||||||
class="content-list__item"
|
class="content-list__item"
|
||||||
v-for="(item, index) in items">
|
v-for="(item, index) in items">
|
||||||
<p class="content-list__numbering">{{ alphaIndex(index) }})</p>
|
<p class="content-list__numbering">{{ alphaIndex(index) }})</p>
|
||||||
<slot :item="item">
|
<slot
|
||||||
|
:item="item"
|
||||||
|
:index="index">
|
||||||
{{ item.id }}
|
{{ item.id }}
|
||||||
</slot>
|
</slot>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -15,17 +15,28 @@
|
||||||
placeholder="z.B. Auftrag 3"
|
placeholder="z.B. Auftrag 3"
|
||||||
@input="val=$event"/>
|
@input="val=$event"/>
|
||||||
</content-form-section>
|
</content-form-section>
|
||||||
|
<div
|
||||||
|
:key="content.id"
|
||||||
|
v-for="content in contents"/>
|
||||||
<div>
|
<div>
|
||||||
<add-content-link/>
|
<add-content-link/>
|
||||||
</div>
|
</div>
|
||||||
<ol class="content-list">
|
|
||||||
<li class="content-list__item">
|
<content-list :items="items">
|
||||||
asdas
|
<template v-slot="{item, index}">
|
||||||
</li>
|
{{ item }}
|
||||||
<li class="content-list__item">
|
<content-element
|
||||||
asdas
|
:element="item"
|
||||||
</li>
|
@update="update(index, $event)"
|
||||||
</ol>
|
@remove="remove(index)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</content-list>
|
||||||
|
<p>hello</p>
|
||||||
|
<content-list
|
||||||
|
:items="items"
|
||||||
|
:starting-index="2"/>
|
||||||
|
<content-block-element-chooser-widget />
|
||||||
</div>
|
</div>
|
||||||
<footer class="create-content-block__footer">
|
<footer class="create-content-block__footer">
|
||||||
<a class="button button--primary">Speichern</a>
|
<a class="button button--primary">Speichern</a>
|
||||||
|
|
@ -40,9 +51,16 @@
|
||||||
import TextForm from '@/components/content-forms/TextForm';
|
import TextForm from '@/components/content-forms/TextForm';
|
||||||
import InputWithLabel from '@/components/ui/InputWithLabel';
|
import InputWithLabel from '@/components/ui/InputWithLabel';
|
||||||
import AddContentLink from '@/components/content-block-form/AddContentLink';
|
import AddContentLink from '@/components/content-block-form/AddContentLink';
|
||||||
|
import ContentList from '@/components/content-blocks/ContentList';
|
||||||
|
import ContentBlockElementChooserWidget from '@/components/content-forms/ContentBlockElementChooserWidget';
|
||||||
|
import test from '@/helpers/content-form/type';
|
||||||
|
import ContentElement from '@/components/content-block-form/ContentElement';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
ContentElement,
|
||||||
|
ContentBlockElementChooserWidget,
|
||||||
|
ContentList,
|
||||||
AddContentLink,
|
AddContentLink,
|
||||||
InputWithLabel,
|
InputWithLabel,
|
||||||
TextForm,
|
TextForm,
|
||||||
|
|
@ -51,8 +69,30 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
val: ''
|
val: '',
|
||||||
})
|
items: [{
|
||||||
|
id: 123,
|
||||||
|
}, {
|
||||||
|
id: 134
|
||||||
|
}],
|
||||||
|
contents: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
type: 'text_block'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
|
||||||
|
mounted() { test(); },
|
||||||
|
methods: {
|
||||||
|
update(index, element) {
|
||||||
|
console.log('updating', index, element);
|
||||||
|
this.items.splice(index, 1, element);
|
||||||
|
},
|
||||||
|
remove(index) {
|
||||||
|
this.items.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue