1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
<div class="erro">
<a-empty :image="simpleImage" />
<div style="width:600px;height:200px;">
<div id="editor"></div>
</div>
</div>
</template>
<script lang="ts" setup>
import { defineExpose,ref,onMounted} from "vue";
import { Empty } from "ant-design-vue";
import { QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css';
const textarea = ref<any>()
const options =ref<any>({
debug: 'info',
modules: {
// toolbar: ['bold', 'italic', 'underline'],
},
placeholder: '批量输入/粘贴 企业名称或者域名,以“行”为分割线;例如以下:\n北京安全共识科技有限公司\n百度网讯科技有限公司',
readOnly: false,
theme: 'snow',
})
// const userSecret = async () => {
// if (QuillEditorRef.value) {
// QuillEditorRef.value.setText('')
// }
// };
const textChange = (e:any) => {
textarea.value = e
console.log(e, '98', textarea.value);
}
onMounted(() => {
const toolbarOptions = ['bold', 'italic', 'underline', 'strike'];
new QuillEditor('#editor', {
})
})
defineExpose({
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
textarea,
options,
textChange,
});
</script>
<style scoped>
.erro {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
</style>