feat(editor): Migrate copyPaste mixin to composables (no-changelog) (#8179)

This commit is contained in:
Alex Grozav
2023-12-29 12:13:24 +02:00
committed by GitHub
parent 216ec079c9
commit f5a4bfe40c
27 changed files with 212 additions and 332 deletions

View File

@@ -23,12 +23,11 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { copyPaste } from '@/mixins/copyPaste';
import { useToast } from '@/composables/useToast';
import { i18n } from '@/plugins/i18n';
import { useClipboard } from '@/composables/useClipboard';
export default defineComponent({
mixins: [copyPaste],
props: {
label: {
type: String,
@@ -68,14 +67,17 @@ export default defineComponent({
},
},
setup() {
const clipboard = useClipboard();
return {
clipboard,
...useToast(),
};
},
methods: {
copy(): void {
this.$emit('copy');
this.copyToClipboard(this.value);
void this.clipboard.copy(this.value);
this.showMessage({
title: this.toastTitle,