@sy-common/wang-editor 1.0.0-beta.17 → 1.0.0-beta.18
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/index.vue +17 -1
package/package.json
CHANGED
package/src/index.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/>
|
|
8
8
|
<!-- 编辑器 -->
|
|
9
9
|
<Editor
|
|
10
|
-
style="
|
|
10
|
+
:style="editorStyle"
|
|
11
11
|
:defaultConfig="editorConfig"
|
|
12
12
|
v-model="html"
|
|
13
13
|
@onChange="onChange"
|
|
@@ -99,6 +99,11 @@ export default {
|
|
|
99
99
|
hideMenu: {
|
|
100
100
|
type: Array,
|
|
101
101
|
default: () => []
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
height: {
|
|
105
|
+
type: Number,
|
|
106
|
+
default: 400
|
|
102
107
|
}
|
|
103
108
|
},
|
|
104
109
|
data() {
|
|
@@ -256,7 +261,18 @@ export default {
|
|
|
256
261
|
}
|
|
257
262
|
},
|
|
258
263
|
computed: {
|
|
264
|
+
editorStyle() {
|
|
265
|
+
let finalHeight = this.height;
|
|
266
|
+
// 如果是数字,自动拼接 px 单位
|
|
267
|
+
if (typeof finalHeight === 'number') {
|
|
268
|
+
finalHeight = `${finalHeight}px`;
|
|
269
|
+
}
|
|
259
270
|
|
|
271
|
+
return {
|
|
272
|
+
height: finalHeight,
|
|
273
|
+
'overflow-y': 'hidden'
|
|
274
|
+
}
|
|
275
|
+
}
|
|
260
276
|
},
|
|
261
277
|
methods: {
|
|
262
278
|
|