Ueditor.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <el-row class="form-group">
  3. <el-col :span="3" style="padding-top:10px;">
  4. <label style="margin-left:10px;vertical-align: middle;" class="control-label">{{label ? label : 'Ue'}}</label>
  5. </el-col>
  6. <el-col :span="21">
  7. <textarea v-bind:id="'container'+name"
  8. style="width:0;height:0.5px;border: 0 solid rgba(255,255,255,0);resize:none;padding:0;outline:none;"
  9. v-model="content_ue"
  10. :name="name ? name : 'ue'">{{content_ue}}</textarea>
  11. </el-col>
  12. </el-row>
  13. </template>
  14. <style scoped>
  15. #ueditor_textarea_content {
  16. width:0;
  17. height:0.5px;
  18. border: 0 solid rgba(255,255,255,0);
  19. display: block;
  20. }
  21. </style>
  22. <script>
  23. export default {
  24. props: ['label','name','value','configs','width','height','enabled'],
  25. data() {
  26. return {
  27. content_ue: this._props.value ? this._props.value : ''
  28. };
  29. },
  30. mounted() {
  31. var configs = this._props.configs ? this._props.configs : {
  32. initialFrameWidth: this._props.width ? this._props.width : 1000 , //> 编辑器默认宽度
  33. initialFrameHeight: this._props.height ? this._props.height : 550, //> 编辑器默认高度
  34. autoFloatEnabled: this._props.enabled ? false : true //> 编辑器默认页头浮动
  35. };
  36. UE.delEditor('container'+this._props.name);
  37. var ue = UE.getEditor('container'+this._props.name,configs);
  38. //ue.ready(function(){
  39. //> 设置编辑器回显内容
  40. //ue.setContent(parents.editContent);
  41. //});
  42. }
  43. }
  44. </script>