1234567891011121314151617181920212223242526272829303132333435363738 |
- export default {
- template: `
- <q-editor
- ref="qRef"
- v-bind="$attrs"
- v-model="inputValue"
- >
- <template v-for="(_, slot) in $slots" v-slot:[slot]="slotProps">
- <slot :name="slot" v-bind="slotProps || {}" />
- </template>
- </q-input>
- `,
- props: {
- value: String,
- },
- data() {
- return {
- inputValue: this.value,
- emitting: true,
- };
- },
- watch: {
- value(newValue) {
- this.emitting = false;
- this.inputValue = newValue;
- this.$nextTick(() => (this.emitting = true));
- },
- inputValue(newValue) {
- if (!this.emitting) return;
- this.$emit("update:value", newValue);
- },
- },
- methods: {
- updateValue() {
- this.inputValue = this.value;
- },
- },
- };
|