亦无哈哈哈

sylan215
关注
149498 号成员,2024-07-11 16:34:48 加入
75
个人主页 浏览
2h49m
在线时长
测试牛
  • 编辑框最大化后还原,框体宽度异常

    2024-10-17 16:45

    参考处理方式:

    $("button[data-type='fullscreen']").click(async function(){ var is_fullscreen = $("#div_vditor").hasClass('vditor--fullscreen') if (!is_fullscreen) { //如果是还原全屏的操作,做一下特殊的修正 $(this).parent().parent().css("padding-left", "35px") var wy_style = $("#div_vditor").find('.vditor-wysiwyg').attr('style') if (wy_style == 'display: block;') { $("#div_vditor").find('.vditor-wysiwyg').find('pre').attr('style', '--editor-bottom: 0px; padding: 10px 35px;') } var ir_style = $("#div_vditor").find('.vditor-ir').attr('style') if (ir_style == 'display: block;') { $("#div_vditor").find('.vditor-ir').find('pre').attr('style', '--editor-bottom: 0px; padding: 10px 35px;') } } });
  • vditor 怎么可以禁用剪贴板功能呀

    2024-10-16 19:44

    我是这样修改剪切板数据的,仅供参考:

    document.addEventListener('copy', function(event) { //监听到剪切板粘贴时间时,做一下额外处理 // 阻止默认行为 event.preventDefault(); // 获取用户选择的内容 var selection = window.getSelection().toString(); // 这里可以修改selection变量以改变复制到剪切板的内容 selection += '\n-----------' selection += '\n版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。' selection += '\n原文链接:https://www.ceshiniu.com' // 使用Clipboard API将内容复制到剪切板 navigator.clipboard.writeText(selection).then(function() { console.log('内容已复制到剪切板'); }, function(err) { console.error('复制失败: ', err); }); });
  • 使用 preview 渲染时,页面总是先闪现一下编辑框,请问如何解决

    2024-09-24 17:32

    目前用了个取巧的办法解决了:默认把 preview 控件隐藏,等 preview 完成后,才显示内容,这样就看不到过程中的编辑框了。

  • 只需要对 markdown 的内容进行渲染时, 使用的 Vditor.preview() 后, 无法点击 md 内容图片进行放大预览吗?

    2024-09-18 11:09

    我是对对 img 元素进行单独处理来实现的打开预览效果image.png