1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <template>
- <textarea v-bind:id="'container'+name"
- style="width:0;height:0.5px;border: 0 solid rgba(255,255,255,0);resize:none;padding:0;outline:none;"
- v-model="content_ue"
- :name="name ? name : 'ue'">{{content_ue}}</textarea>
- </template>
- <style scoped>
- #ueditor_textarea_content {
- width:0;
- height:0.5px;
- border: 0 solid rgba(255,255,255,0);
- display: block;
- }
- </style>
- <script>
- export default {
- props: ['label','name','value','configs','width','height','enabled'],
- data() {
- return {
- content_ue: this._props.value ? this._props.value : ''
- };
- },
- mounted() {
- var configs = this._props.configs ? this._props.configs : {
- initialFrameWidth: this._props.width ? this._props.width : 1000 , //> 编辑器默认宽度
- initialFrameHeight: this._props.height ? this._props.height : 550, //> 编辑器默认高度
- autoFloatEnabled: this._props.enabled ? false : true //> 编辑器默认页头浮动
- };
- UE.delEditor('container'+this._props.name);
- var vm_ue=this;
- var ue = UE.getEditor('container'+this._props.name,configs);
- ue.addListener("contentChange", function () {
- var content = ue.getContent();
- console.log(content);
- vm_ue.$emit('set-keys',content);
- });
- //ue.ready(function(){
- //> 设置编辑器回显内容
- //ue.setContent(parents.editContent);
- //});
- },
- watch:{
- 'content_ue':function () {
- console.log(this.content_ue);
- this.$emit('set-keys',this.content_ue);
- },
- }
- }
- </script>
|