zydx-plus 1.19.93 → 1.19.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/editor/src/editor.vue +1 -3
- package/src/components/editor/src/menu.js +70 -8
- package/src/components/editor2/src/editor.vue +6 -2
- package/src/components/flip/src/flip.vue +145 -182
- package/src/components/select/src/select.vue +8 -6
- package/src/components/tab/src/tab.vue +9 -0
- package/src/components/textarea/src/textarea.vue +2 -2
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -80,12 +80,10 @@ export default defineComponent({
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
mounted() {
|
|
83
|
-
setTimeout(() => {
|
|
84
83
|
this.formData.html = this.html
|
|
85
84
|
setTimeout(() => {
|
|
86
|
-
|
|
85
|
+
if(this.readOnly) this.opts.editable.config.readOnly = this.readOnly
|
|
87
86
|
},0)
|
|
88
|
-
},0)
|
|
89
87
|
},
|
|
90
88
|
setup(props) {
|
|
91
89
|
const { opts, handle, instance, clearContent, syncContent, reloadEditor } = useWangEditor({
|
|
@@ -42,16 +42,14 @@ class signButtonMenu {
|
|
|
42
42
|
let nodes = JSON.parse(JSON.stringify(node)) //拷贝一份
|
|
43
43
|
if(typeCode(node,'attachment')) return
|
|
44
44
|
const resume = {
|
|
45
|
-
type: '
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
link: signData.ico,
|
|
50
|
-
children: [{text:''}]
|
|
51
|
-
}]
|
|
45
|
+
type: 'attachment',
|
|
46
|
+
fileName: signData.text,
|
|
47
|
+
link: signData.ico,
|
|
48
|
+
children: [{text:''}]
|
|
52
49
|
}
|
|
53
50
|
nodes.unshift(resume)
|
|
54
51
|
editor.clear()
|
|
52
|
+
console.log(nodes)
|
|
55
53
|
for(let i = 0; i < nodes.length; i++){
|
|
56
54
|
editor.insertNode(nodes[i])
|
|
57
55
|
}
|
|
@@ -166,6 +164,64 @@ class titleButtonMenu {
|
|
|
166
164
|
}
|
|
167
165
|
}
|
|
168
166
|
|
|
167
|
+
class literatureButtonMenu {
|
|
168
|
+
constructor(v) {
|
|
169
|
+
titleData = v
|
|
170
|
+
this.title = '参考文献' // 自定义菜单标题
|
|
171
|
+
this.tag = 'button'
|
|
172
|
+
}
|
|
173
|
+
// 获取菜单执行时的 value ,用不到则返回空 字符串或 false
|
|
174
|
+
getValue(editor) {
|
|
175
|
+
return false
|
|
176
|
+
}
|
|
177
|
+
// 菜单是否需要激活(如选中加粗文本,“加粗”菜单会激活),用不到则返回 false
|
|
178
|
+
isActive(editor) {
|
|
179
|
+
return false
|
|
180
|
+
}
|
|
181
|
+
// 菜单是否需要禁用(如选中 H1 ,“引用”菜单被禁用),用不到则返回 false
|
|
182
|
+
isDisabled(editor) {
|
|
183
|
+
return false
|
|
184
|
+
}
|
|
185
|
+
// 点击菜单时触发的函数
|
|
186
|
+
exec(editor, value) {
|
|
187
|
+
if (this.isDisabled(editor)) return
|
|
188
|
+
const resume = {
|
|
189
|
+
type: 'attachment',
|
|
190
|
+
text: '[1]作者.期刊论文名称IJ1.期刊名称,发表年份(第几期):页码',
|
|
191
|
+
color: '#000000',
|
|
192
|
+
fontSize: '14px',
|
|
193
|
+
}
|
|
194
|
+
const resume2 = {
|
|
195
|
+
type: 'paragraph',
|
|
196
|
+
children: [{
|
|
197
|
+
text: '[2]作者.学位论文名称[D1.毕业院校所在城市:毕业院校,论文提交年份:页码',
|
|
198
|
+
color: '#000000',
|
|
199
|
+
fontSize: '14px',
|
|
200
|
+
}]
|
|
201
|
+
}
|
|
202
|
+
const resume3 = {
|
|
203
|
+
type: 'paragraph',
|
|
204
|
+
children: [{
|
|
205
|
+
text: '[3]作者.著作名称[M.出版社所在城市:出版社名称,出版年份:页码.',
|
|
206
|
+
color: '#000000',
|
|
207
|
+
fontSize: '14px',
|
|
208
|
+
}]
|
|
209
|
+
}
|
|
210
|
+
const resume4 = {
|
|
211
|
+
type: 'paragraph',
|
|
212
|
+
children: [{
|
|
213
|
+
text: '[4]作者.文章名称[N].报纸名称,发行日期(版面)',
|
|
214
|
+
color: '#000000',
|
|
215
|
+
fontSize: '14px',
|
|
216
|
+
}]
|
|
217
|
+
}
|
|
218
|
+
editor.insertNode(resume)
|
|
219
|
+
editor.insertNode(resume2)
|
|
220
|
+
editor.insertNode(resume3)
|
|
221
|
+
editor.insertNode(resume4)
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
169
225
|
const signMenuConf = {
|
|
170
226
|
key: 'signMenu',
|
|
171
227
|
factory(v) {
|
|
@@ -186,7 +242,13 @@ const titleMenuConf = {
|
|
|
186
242
|
return new titleButtonMenu(v)
|
|
187
243
|
},
|
|
188
244
|
}
|
|
245
|
+
const literatureMenuConf = {
|
|
246
|
+
key: 'literatureMenu',
|
|
247
|
+
factory(v) {
|
|
248
|
+
return new literatureButtonMenu(v)
|
|
249
|
+
},
|
|
250
|
+
}
|
|
189
251
|
|
|
190
252
|
export const menuModule = {
|
|
191
|
-
menus: [signMenuConf,redMenuConf,titleMenuConf]
|
|
253
|
+
menus: [signMenuConf,redMenuConf,titleMenuConf,literatureMenuConf]
|
|
192
254
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
16
|
<div class="ed-cont" :style="heightStyleCont">
|
|
17
|
-
<div :style="{'border': (
|
|
17
|
+
<div :style="{'border': (borderShow)? '1px solid #ccc': '0'}" v-if="editorShow">
|
|
18
18
|
<editor-content class="editor" :editor="editor" :style="heightStyleCont" />
|
|
19
19
|
</div>
|
|
20
20
|
<div class="editor-but" v-if="butText !== ''&& readOnly">
|
|
@@ -154,6 +154,10 @@ export default {
|
|
|
154
154
|
editorShow: {
|
|
155
155
|
type: Boolean,
|
|
156
156
|
default: true
|
|
157
|
+
},
|
|
158
|
+
borderShow: {
|
|
159
|
+
type: Boolean,
|
|
160
|
+
default: true
|
|
157
161
|
}
|
|
158
162
|
},
|
|
159
163
|
emits: ['see','del','complete','update:data'],
|
|
@@ -297,7 +301,7 @@ export default {
|
|
|
297
301
|
const url = this.uploadImage.url + this.uploadAttData[index].filePath
|
|
298
302
|
let a = document.createElement('a');
|
|
299
303
|
a.style.display = 'none';
|
|
300
|
-
a.download = this.uploadAttData[index].filename;
|
|
304
|
+
a.download = this.uploadAttData[index].filename? this.uploadAttData[index].filename : this.uploadAttData[index].annexName;
|
|
301
305
|
a.href = url;
|
|
302
306
|
document.body.appendChild(a);
|
|
303
307
|
a.click();
|
|
@@ -1,130 +1,136 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<!-- <div class="paper z-in-
|
|
14
|
-
<!-- <div class="page page-2" id="canvas-
|
|
15
|
-
<!-- <div class="page page-2-back" id="canvas-
|
|
16
|
-
<!-- </div>-->
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
<div class="docView">
|
|
3
|
+
<div style="height: 100%;">
|
|
4
|
+
<div class="book">
|
|
5
|
+
<div class="pages">
|
|
6
|
+
<div class="wrap">
|
|
7
|
+
<div class="wrap-can">
|
|
8
|
+
<canvas :id="id"></canvas>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="page-but-left" :style="{cursor: pageIndex === 1?'default':'pointer'}" @click="flipLeft(pageIndex-=1,false)"></div>
|
|
12
|
+
<div class="page-but-right" :style="{cursor: pageIndex === pdfPages?'default':'pointer'}" @click="flipRight(pageIndex+=1,false)"></div>
|
|
13
|
+
<!-- <div class="paper z-in" :class="{'data-right': pages}">-->
|
|
14
|
+
<!-- <div class="page page-2" id="canvas-wrap1"></div>-->
|
|
15
|
+
<!-- <div class="page page-2-back" id="canvas-wrap2"></div>-->
|
|
16
|
+
<!-- </div>-->
|
|
17
|
+
<!-- <div class="paper z-in-ac">-->
|
|
18
|
+
<!-- <div class="page page-2" id="canvas-wrap3"></div>-->
|
|
19
|
+
<!-- <div class="page page-2-back" id="canvas-wrap4"></div>-->
|
|
20
|
+
<!-- </div>-->
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="but-wrap" v-if="butShow">
|
|
24
|
+
<button class="but-brown" :disabled="pageIndex === 1" :class="{'but-act': pageIndex === 1}" @click="flipLeft(pageIndex-=1,false)">上一页</button>
|
|
25
|
+
<button class="but-brown" :disabled="pageIndex === pdfPages" :class="{'but-act': pageIndex === pdfPages}" @click="flipRight(pageIndex+=1,false)">下一页</button>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
25
29
|
</template>
|
|
26
30
|
|
|
27
31
|
<script>
|
|
28
|
-
import * as PdfJs from 'pdfjs-dist/legacy/build/pdf.js' // 注意导入的写法
|
|
32
|
+
import * as PdfJs from 'pdfjs-dist/legacy/build/pdf.js' // 注意导入的写法d
|
|
29
33
|
PdfJs.GlobalWorkerOptions.workerSrc = require('pdfjs-dist/build/pdf.worker.entry')
|
|
30
34
|
export default {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
name: "zydx-flip",
|
|
36
|
+
data() {
|
|
37
|
+
return {
|
|
38
|
+
pdfPages: 0,
|
|
39
|
+
imgArr: {},
|
|
40
|
+
hei: 0,
|
|
41
|
+
pageIndex: this.page,
|
|
42
|
+
show: false,
|
|
43
|
+
load: 0,
|
|
44
|
+
loadWidth: 0,
|
|
45
|
+
pages: false,
|
|
46
|
+
pagesData: [],
|
|
47
|
+
opacity: 1,
|
|
48
|
+
id: null
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
source: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: ''
|
|
55
|
+
},
|
|
56
|
+
singlePage: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
butShow: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true
|
|
63
|
+
},
|
|
64
|
+
page: {
|
|
65
|
+
type: Number,
|
|
66
|
+
default: 1
|
|
67
|
+
}
|
|
50
68
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
69
|
+
watch: {
|
|
70
|
+
page: {
|
|
71
|
+
handler: function (val, oldVal) {
|
|
72
|
+
this.pageIndex = val
|
|
73
|
+
},
|
|
74
|
+
immediate: true
|
|
75
|
+
}
|
|
54
76
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
77
|
+
emits: ['flip'],
|
|
78
|
+
mounted() {
|
|
79
|
+
this.readPdf()
|
|
80
|
+
this.id = 'canvas-wrap' + Math.random().toString(36).substr(2)
|
|
58
81
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
82
|
+
methods: {
|
|
83
|
+
flipLeft(e,v) {
|
|
84
|
+
if(e <= 1) {
|
|
85
|
+
this.pageIndex = 1
|
|
86
|
+
}else {
|
|
87
|
+
this.pageIndex = e
|
|
88
|
+
}
|
|
89
|
+
this.readPdf()
|
|
90
|
+
if(!v) {
|
|
91
|
+
this.$emit('flip', {
|
|
92
|
+
page: this.pageIndex,
|
|
93
|
+
total: this.pdfPages
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
flipRight(e,v) {
|
|
98
|
+
if(e >= this.pdfPages) {
|
|
99
|
+
this.pageIndex = this.pdfPages
|
|
100
|
+
}else {
|
|
101
|
+
this.pageIndex = e
|
|
102
|
+
}
|
|
103
|
+
this.readPdf()
|
|
104
|
+
if(!v) {
|
|
105
|
+
this.$emit('flip', {
|
|
106
|
+
page: this.pageIndex,
|
|
107
|
+
total: this.pdfPages
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
readPdf() {
|
|
112
|
+
let that = this
|
|
113
|
+
const loadingTask = PdfJs.getDocument(this.source)
|
|
114
|
+
loadingTask.promise.then((pdf) => {
|
|
115
|
+
that.pdfPages = pdf.numPages // 获取pdf文件的总页数
|
|
116
|
+
pdf.getPage(that.pageIndex).then(function (page) {
|
|
117
|
+
let canvas = document.getElementById(that.id)
|
|
118
|
+
let ctx = canvas.getContext('2d');
|
|
119
|
+
let viewport = page.getViewport({scale: 1})
|
|
120
|
+
canvas.width = viewport.width * 2
|
|
121
|
+
canvas.height = viewport.height * 2
|
|
122
|
+
canvas.style.width = viewport.width + 'px'
|
|
123
|
+
canvas.style.height = viewport.height + 'px'
|
|
124
|
+
let renderContext = {
|
|
125
|
+
canvasContext: ctx,
|
|
126
|
+
viewport: viewport,
|
|
127
|
+
transform: [2, 0, 0, 2, 0, 0]//这里会进行放大,解决模糊问题
|
|
128
|
+
}
|
|
129
|
+
page.render(renderContext)
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
}
|
|
62
133
|
}
|
|
63
|
-
},
|
|
64
|
-
watch: {
|
|
65
|
-
page: {
|
|
66
|
-
handler: function (val, oldVal) {
|
|
67
|
-
this.pageIndex = val
|
|
68
|
-
},
|
|
69
|
-
immediate: true
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
emits: ['flip'],
|
|
73
|
-
mounted() {
|
|
74
|
-
this.readPdf()
|
|
75
|
-
},
|
|
76
|
-
methods: {
|
|
77
|
-
flipLeft(e,v) {
|
|
78
|
-
if(e <= 1) {
|
|
79
|
-
this.pageIndex = 1
|
|
80
|
-
}else {
|
|
81
|
-
this.pageIndex = e
|
|
82
|
-
}
|
|
83
|
-
this.readPdf()
|
|
84
|
-
if(!v) {
|
|
85
|
-
this.$emit('flip', {
|
|
86
|
-
page: this.pageIndex,
|
|
87
|
-
total: this.pdfPages
|
|
88
|
-
})
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
flipRight(e,v) {
|
|
92
|
-
if(e >= this.pdfPages) {
|
|
93
|
-
this.pageIndex = this.pdfPages
|
|
94
|
-
}else {
|
|
95
|
-
this.pageIndex = e
|
|
96
|
-
}
|
|
97
|
-
this.readPdf()
|
|
98
|
-
if(!v) {
|
|
99
|
-
this.$emit('flip', {
|
|
100
|
-
page: this.pageIndex,
|
|
101
|
-
total: this.pdfPages
|
|
102
|
-
})
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
readPdf() {
|
|
106
|
-
let that = this
|
|
107
|
-
const loadingTask = PdfJs.getDocument(this.source)
|
|
108
|
-
loadingTask.promise.then((pdf) => {
|
|
109
|
-
that.pdfPages = pdf.numPages // 获取pdf文件的总页数
|
|
110
|
-
pdf.getPage(that.pageIndex).then(function (page) {
|
|
111
|
-
let viewport = page.getViewport({scale: 1})
|
|
112
|
-
document.getElementById('canvas-wrap').innerHTML = ''
|
|
113
|
-
let container = document.createElement('div')
|
|
114
|
-
container.style.width = viewport.width + 'px'
|
|
115
|
-
container.style.height = viewport.height + 'px'
|
|
116
|
-
container.style.margin = '0 auto'
|
|
117
|
-
document.getElementById('canvas-wrap').appendChild(container)
|
|
118
|
-
return page.getOperatorList().then(function(opList) {
|
|
119
|
-
let svgGfx = new PdfJs.SVGGraphics(page.commonObjs, page.objs)
|
|
120
|
-
return svgGfx.getSVG(opList, viewport).then(function(svg) {
|
|
121
|
-
container.appendChild(svg)
|
|
122
|
-
})
|
|
123
|
-
})
|
|
124
|
-
})
|
|
125
|
-
})
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
134
|
}
|
|
129
135
|
</script>
|
|
130
136
|
|
|
@@ -132,64 +138,21 @@ export default {
|
|
|
132
138
|
.wrap{
|
|
133
139
|
width: 100%;
|
|
134
140
|
height: 100%;
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
}
|
|
144
|
+
.wrap-can{
|
|
145
|
+
display: inline-block;
|
|
146
|
+
margin: 0 auto;
|
|
135
147
|
}
|
|
136
148
|
.but-wrap{
|
|
137
149
|
text-align: center;
|
|
138
150
|
}
|
|
139
|
-
.z-in{
|
|
140
|
-
z-index: 2;
|
|
141
|
-
}
|
|
142
|
-
.z-in-ac{
|
|
143
|
-
z-index: 1;
|
|
144
|
-
}
|
|
145
151
|
.pages{
|
|
146
152
|
width: 100%;
|
|
147
153
|
height: 100%;
|
|
148
154
|
position: relative;
|
|
149
155
|
}
|
|
150
|
-
.paper{
|
|
151
|
-
position: absolute;
|
|
152
|
-
right: 0;
|
|
153
|
-
transform-style: preserve-3d;
|
|
154
|
-
width: 100%;
|
|
155
|
-
}
|
|
156
|
-
.page{
|
|
157
|
-
position: absolute;
|
|
158
|
-
text-align: center;
|
|
159
|
-
}
|
|
160
|
-
.page img{
|
|
161
|
-
width: 100%;
|
|
162
|
-
height: 100%;
|
|
163
|
-
}
|
|
164
|
-
.data-right {
|
|
165
|
-
opacity: 1;
|
|
166
|
-
transform-origin: left center;
|
|
167
|
-
animation: flip-to-left 1.5s ease-in-out forwards;
|
|
168
|
-
}
|
|
169
|
-
.data-left{
|
|
170
|
-
right: auto;
|
|
171
|
-
left: 0;
|
|
172
|
-
}
|
|
173
|
-
@keyframes flip-to-left {
|
|
174
|
-
0% {
|
|
175
|
-
transform: perspective(3000px) rotateY(0);
|
|
176
|
-
}
|
|
177
|
-
95% {
|
|
178
|
-
transform: perspective(3000px) rotateY(-180deg);
|
|
179
|
-
}
|
|
180
|
-
100% {
|
|
181
|
-
transform: perspective(3000px) rotateY(-180deg);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
.page-1-back, .page-2-back {
|
|
185
|
-
transform: scale(-1, 1);
|
|
186
|
-
}
|
|
187
|
-
.page-1, .page-2 {
|
|
188
|
-
transform: translateZ(1px);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
156
|
|
|
194
157
|
.page-but-left{
|
|
195
158
|
position: absolute;
|
|
@@ -214,27 +177,27 @@ export default {
|
|
|
214
177
|
padding-bottom: 10px;
|
|
215
178
|
font-size: 14px;
|
|
216
179
|
}
|
|
217
|
-
|
|
218
|
-
|
|
180
|
+
.docView{
|
|
181
|
+
height: 100%;
|
|
219
182
|
}
|
|
220
183
|
.but-brown{
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
184
|
+
background-color: #c64c10;
|
|
185
|
+
padding: 0 20px;
|
|
186
|
+
font-size: 12px;
|
|
187
|
+
color: #fff;
|
|
188
|
+
height: 24px;
|
|
189
|
+
line-height: 24px;
|
|
190
|
+
border-radius: 5px;
|
|
191
|
+
border: 0;
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
margin-left: 10px;
|
|
231
194
|
}
|
|
232
195
|
.book{
|
|
233
|
-
|
|
234
|
-
|
|
196
|
+
width: 100%;
|
|
197
|
+
height: 100%;
|
|
235
198
|
}
|
|
236
|
-
|
|
199
|
+
.but-act{
|
|
237
200
|
background-color: #bbbbbb;
|
|
238
201
|
color: #fff;
|
|
239
|
-
|
|
202
|
+
}
|
|
240
203
|
</style>
|
|
@@ -21,12 +21,14 @@
|
|
|
21
21
|
</svg>
|
|
22
22
|
</span>
|
|
23
23
|
<transition>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
<template v-if="options.length">
|
|
25
|
+
<ul v-if="isOpen"
|
|
26
|
+
:class="{ 'custom-select-options': true, 'scroll': maxHeight > 0 }">
|
|
27
|
+
<li v-for="(option, idx) in options"
|
|
28
|
+
:key="idx"
|
|
29
|
+
@click="handleClick(option)">{{ option.label }}</li>
|
|
30
|
+
</ul>
|
|
31
|
+
</template>
|
|
30
32
|
</transition>
|
|
31
33
|
</div>
|
|
32
34
|
</div>
|
|
@@ -35,6 +35,15 @@ export default {
|
|
|
35
35
|
default: () => ['name']
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
|
+
watch: {
|
|
39
|
+
active(val) {
|
|
40
|
+
this.list.forEach((item, index) => {
|
|
41
|
+
if (item[this.activeId] === val) {
|
|
42
|
+
this.actives = index
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
},
|
|
38
47
|
mounted() {
|
|
39
48
|
if (this.activeId) {
|
|
40
49
|
this.list.forEach((item, index) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="text" :style="{'min-height': height + 'px'}" contenteditable="true" ref="textarea"></div>
|
|
2
|
+
<div class="text" :style="{'min-height': height + 'px'}" :contenteditable="true" ref="textarea"></div>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
height: {
|
|
17
17
|
type: Number,
|
|
18
18
|
default: 200
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
20
|
},
|
|
21
21
|
watch: {
|
|
22
22
|
value(val) {
|