Refactor event names
This commit is contained in:
parent
d3c790d221
commit
dfb1a3ac5a
|
|
@ -5,32 +5,43 @@
|
||||||
v-bind="element"
|
v-bind="element"
|
||||||
:is="type(element)"
|
:is="type(element)"
|
||||||
@change-type="changeType"
|
@change-type="changeType"
|
||||||
|
|
||||||
@link-change-url="changeText"
|
|
||||||
@link-change-text="changeText"
|
|
||||||
@text-change-value="changeText"
|
|
||||||
@document-change-url="changeUrl"
|
|
||||||
@image-change-url="changeUrl"
|
|
||||||
@video-change-url="changeUrl"
|
|
||||||
@switch-to-document="switchToDocument"
|
|
||||||
|
|
||||||
@assignment-change-title="changeAssignmentTitle"
|
|
||||||
@assignment-change-assignment="changeAssignmentAssignment"
|
|
||||||
/>
|
/>
|
||||||
|
<content-form-section
|
||||||
<a
|
:title="title"
|
||||||
class="contents-form__remove icon-button"
|
v-else
|
||||||
@click="$emit('remove')"
|
|
||||||
>
|
>
|
||||||
<trash-icon
|
<div class="content-element__section">
|
||||||
class="contents-form__trash-icon icon-button__icon"
|
<component
|
||||||
v-if="type(element) !== 'content-block-element-chooser-widget'"
|
:class="['content-element__component']"
|
||||||
/>
|
v-bind="element"
|
||||||
</a>
|
:is="component"
|
||||||
|
|
||||||
|
@change-text="changeText"
|
||||||
|
|
||||||
|
@link-change-url="changeUrl"
|
||||||
|
@change-url="changeUrl"
|
||||||
|
|
||||||
|
@switch-to-document="switchToDocument"
|
||||||
|
|
||||||
|
@assignment-change-title="changeAssignmentTitle"
|
||||||
|
@assignment-change-assignment="changeAssignmentAssignment"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<a
|
||||||
|
class="contents-form__remove icon-button"
|
||||||
|
@click="$emit('remove')"
|
||||||
|
>
|
||||||
|
<trash-icon
|
||||||
|
class="contents-form__trash-icon icon-button__icon"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</content-form-section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import ContentFormSection from '@/components/content-block-form/ContentFormSection';
|
||||||
const TrashIcon = () => import(/* webpackChunkName: "icons" */'@/components/icons/TrashIcon');
|
const TrashIcon = () => import(/* webpackChunkName: "icons" */'@/components/icons/TrashIcon');
|
||||||
const ContentBlockElementChooserWidget = () => import(/* webpackChunkName: "content-forms" */'@/components/content-forms/ContentBlockElementChooserWidget');
|
const ContentBlockElementChooserWidget = () => import(/* webpackChunkName: "content-forms" */'@/components/content-forms/ContentBlockElementChooserWidget');
|
||||||
const LinkForm = () => import(/* webpackChunkName: "content-forms" */'@/components/content-forms/LinkForm');
|
const LinkForm = () => import(/* webpackChunkName: "content-forms" */'@/components/content-forms/LinkForm');
|
||||||
|
|
@ -49,6 +60,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
ContentFormSection,
|
||||||
TrashIcon,
|
TrashIcon,
|
||||||
ContentBlockElementChooserWidget,
|
ContentBlockElementChooserWidget,
|
||||||
LinkForm,
|
LinkForm,
|
||||||
|
|
@ -153,7 +165,7 @@
|
||||||
if (convertToList) {
|
if (convertToList) {
|
||||||
console.log(el);
|
console.log(el);
|
||||||
el = {
|
el = {
|
||||||
type: 'content_list_item',
|
type: 'content_list_item',
|
||||||
contents: [el]
|
contents: [el]
|
||||||
};
|
};
|
||||||
console.log(el);
|
console.log(el);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
uploadcare(this, url => {
|
uploadcare(this, url => {
|
||||||
this.$emit('link-change-url', url, this.index);
|
this.$emit('change-url', url, this.index);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
this.hadError = false;
|
this.hadError = false;
|
||||||
this.url = fileInfo.cdnUrl;
|
this.url = fileInfo.cdnUrl;
|
||||||
this.filename = fileInfo.name;
|
this.filename = fileInfo.name;
|
||||||
this.$emit('link-change-url', fileInfo.cdnUrl, this.index);
|
this.$emit('change-url', fileInfo.cdnUrl, this.index);
|
||||||
});
|
});
|
||||||
|
|
||||||
// the api also provides these methods
|
// the api also provides these methods
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@
|
||||||
:value="value.text"
|
:value="value.text"
|
||||||
placeholder="Name erfassen..."
|
placeholder="Name erfassen..."
|
||||||
class="link-form__text skillbox-input"
|
class="link-form__text skillbox-input"
|
||||||
@input="$emit('link-change-text', $event.target.value, index)"
|
@input="$emit('change-text', $event.target.value, index)"
|
||||||
>
|
>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
:value="value.url"
|
:value="value.url"
|
||||||
placeholder="URL einfügen..."
|
placeholder="URL einfügen..."
|
||||||
class="link-form__url skillbox-input"
|
class="link-form__url skillbox-input"
|
||||||
@input="$emit('link-change-url', $event.target.value, index)"
|
@input="$emit('change-url', $event.target.value, index)"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
class="text-form__input skillbox-textarea"
|
class="text-form__input skillbox-textarea"
|
||||||
data-cy="text-form-input"
|
data-cy="text-form-input"
|
||||||
placeholder="Text erfassen..."
|
placeholder="Text erfassen..."
|
||||||
@input="$emit('text-change-value', $event.target.value, index)"
|
@input="$emit('change-text', $event.target.value, index)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
</h3>
|
</h3>
|
||||||
<text-form
|
<text-form
|
||||||
:value="v"
|
:value="v"
|
||||||
@text-change-value="$emit('change', $event)"
|
@change-text="$emit('change', $event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
:value="value.url"
|
:value="value.url"
|
||||||
class="video-form__video-link skillbox-input"
|
class="video-form__video-link skillbox-input"
|
||||||
placeholder="Bsp: https://www.youtube.com/watch?v=dQw4w9WgXcQ"
|
placeholder="Bsp: https://www.youtube.com/watch?v=dQw4w9WgXcQ"
|
||||||
@input="$emit('video-change-url', $event.target.value, index)"
|
@input="$emit('change-url', $event.target.value, index)"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue