javascript - 在vue中,如何多次调用ueditor?
大家讲道理
大家讲道理 2017-04-11 10:23:43
0
1
269

在webpack的模块化构建当中,使用vue开发

在组件内import了ueditor,第一次打开或刷新页面,ueditor是正常渲染的

ueditor渲染在一个弹窗当中,弹窗关闭后,ueditor被销毁,再次打开弹窗,则ueditor没有被渲染

由于是spa应用,许多时候没有被刷新,那么,怎么让ueditor多次渲染?而避免刷新呢?


import '../../static/ueditor/ueditor.config.js'
import '../../static/ueditor/ueditor.all.js'
import '../../static/ueditor/lang/zh-cn/zh-cn.js'

// 在mounted中执行

UE.getEditor('content', {
          UEDITOR_HOME_URL: __dirname + 'static/ueditor/',
          serverUrl: config.ajaxUrl + '/ueditor/jsp/controller.jsp',
          autoHeight: false,
          initialFrameHeight: '250',
          emotionLocalization: true,
          scaleEnabled: true,
          toolbars: [[
            'fullscreen','undo', 'redo','emotion','bold', 'italic', 'underline','forecolor', 'backcolor','insertimage','blockquote','justifyleft', 'justifycenter', 'justifyright','inserttable'
          ]]
        });

模板:

<script id="content" name="content" type="text/plain"></script>

very much Thanks in advance.

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!