小编DMC*_*DMC的帖子

CKEditor 4和jQuery UI sortable在排序后删除内容

我遇到了CKEditor 4和jQuery UI的可排序方法的问题,如果我对具有CKEditor实例的容器进行排序,它会删除该值并抛出错误"未捕获的TypeError:无法调用未定义的方法'getSelection'".它也使编辑器无法编辑.我能够在CKEditor 3中解决这个问题,其中包含以下黑客攻击之一: CKEditor冻结jQuery UI重新排序

在查看Chrome DOM检查器时,似乎会删除iframe的内容.

以下是原始测试代码:


    <html>
    <head>
        <title>test</title>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
        <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js"></script>
        <script src="ckeditor.js"></script>
        <script type="text/javascript">
        $(function(){

            var tmpStore = {};
            $('#sortable').sortable({
                cursor: 'move',

                // Hack that use to work on V3 but not on V4:
                // https://stackoverflow.com/questions/3379653/ckeditor-freezes-on-jquery-ui-reorder
                start:function (event,ui) {
                    $('textarea').each(function(){
                        var id = $(this).attr('id');
                        tmpStore[id] = CKEDITOR.instances[id].getData();
                    })
                 },
                stop: function(event, ui) { 
                    $('textarea').each(function(){
                        var id = $(this).attr('id');
                        CKEDITOR.instances[id].setData(tmpStore[id]);
                    })
                  }
            });
            $('textarea').each(function(){
                var ckId = $(this).attr('id');
                config = {};
                CKEDITOR.replace(ckId, config);
            })
        }) …

jquery-ui jquery-ui-sortable ckeditor

8
推荐指数
2
解决办法
4622
查看次数

Vue.js Vite 构建错误 &lt;video&gt;&lt;source&gt; 标签

我正在开发一个 Vue 3 应用程序,并尝试将静态图像替换为视频,但它抛出了一个错误

[vite] Build errored out.
Error: Unexpected character '' (Note that you need plugins to import files that are not JavaScript) at error (/myapp/node_modules/rollup/dist/shared/rollup.js:5275:30)
...
Run Code Online (Sandbox Code Playgroud)

此构建(不是您使用图像,只是为了显示):

[vite] Build errored out.
Error: Unexpected character '' (Note that you need plugins to import files that are not JavaScript) at error (/myapp/node_modules/rollup/dist/shared/rollup.js:5275:30)
...
Run Code Online (Sandbox Code Playgroud)

这不会:

<video class="w-2/3 xs:w-full" controls="controls" name="Video Name">
     <source src="/images/my_image.png">
</video>
Run Code Online (Sandbox Code Playgroud)

我是 Vite 的新手,我试图理解为什么它似乎想要从 HTML 标签导入视频。

vue.js rollupjs vite

5
推荐指数
2
解决办法
3553
查看次数