WANG 6 vuotta sitten
vanhempi
commit
9c9d1835a7
1 muutettua tiedostoa jossa 22 lisäystä ja 7 poistoa
  1. 22 7
      src/components/ckeditor.vue

+ 22 - 7
src/components/ckeditor.vue

@@ -1,17 +1,24 @@
 <template>
-  <div class="ckeditor">
-    <textarea
-      :id="id"
-      :display="display"
-      :value="value"
-      class="el-textarea__inner"
-    ></textarea>
+  <div :style="divStyle">
+    <div class="ckeditor">
+      <textarea
+        :id="id"
+        :display="display"
+        :value="value"
+        class="el-textarea__inner"
+      ></textarea>
+    </div>
   </div>
 </template>
 
 <script>
 let inc = 0;
 export default {
+  data() {
+    return {
+      divStyle: null
+    };
+  },
   props: {
     display: {
       type: String,
@@ -52,6 +59,14 @@ export default {
     }
   },
   mounted() {
+    if (this.width) {
+      this.divStyle = "width:" + this.width + ";";
+    } else {
+      this.divStyle = "width:500px";
+    }
+
+    this.divStyle = this.divStyle + "margin-top:-15px;";
+
     let config = {
       language: this.language,
       height: this.height,