@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.vue +17 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sy-common/wang-editor",
3
- "version": "1.0.0-beta.17",
3
+ "version": "1.0.0-beta.18",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
package/src/index.vue CHANGED
@@ -7,7 +7,7 @@
7
7
  />
8
8
  <!-- 编辑器 -->
9
9
  <Editor
10
- style="height: 400px; overflow-y: hidden;"
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