还是LZM
还是LZM
  • 发布:2024-10-31 14:54
  • 更新:2024-10-31 14:58
  • 阅读:61

【报Bug】使用editor组件就会报错

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 22H2

HBuilderX类型: Alpha

HBuilderX版本号: 4.17

浏览器平台: Chrome

浏览器版本: 123.0.6262.5

项目创建方式: HBuilderX

示例代码:

<editor></editor>

操作步骤:

<editor></editor>

chunk-vendors.js:70854 [Vue warn]: Error in mounted hook: "TypeError: Cannot read properties of undefined (reading 'id')"

预期结果:

正常运行

实际结果:

报错chunk-vendors.js:70854 [Vue warn]: Error in mounted hook: "TypeError: Cannot read properties of undefined (reading 'id')"

bug描述:

使用editor组件,什么都还没做 就 加入了<editor></editor>,就报错了

chunk-vendors.js:70854 [Vue warn]: Error in mounted hook: "TypeError: Cannot read properties of undefined (reading 'id')"

2024-10-31 14:54 负责人:无 分享
已邀请:
靐齉齾麤龖龗

靐齉齾麤龖龗 - 解决不了问题,那就解决提出问题的人

看看你整个页面的代码呢

  • 还是LZM (作者)

    组件 my-editor:

    <template>

    <view class="container">

    <view class="page-body">

    <view class='wrapper'>

    <view class="editor-wrapper">

    <editor id="editor"></editor>

    </view>

    </view>


        </view>  
    </view>

    </template>


    <script>

    export default {

    name: "my-editor",


        data() {  
    return {
    readOnly: false,
    formats: {},

    editorCtx:null,
    };
    },
    onLoad() {

    },
    mounted(){
    var that = this;
    // that.onEditorReady();
    },
    methods: {

    }
    }

    </script>


    <style>

    / @import "./editor-icon.css"; /

    @import '/style/editor-icon.css';


    .page-body {  
    height: calc(100vh - var(--window-top) - var(--status-bar-height));
    }

    .wrapper {
    height: 100%;
    }

    .editor-wrapper {
    height: calc(100vh - var(--window-top) - var(--status-bar-height) - 140px);
    background: #fff;
    }

    .iconfont {
    display: inline-block;
    padding: 8px 8px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 20px;
    }

    .toolbar {
    box-sizing: border-box;
    border-bottom: 0;
    font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    }

    .ql-container {
    box-sizing: border-box;
    padding: 12px 15px;
    width: 100%;
    min-height: 30vh;
    height: 100%;
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.5;
    }

    .ql-active {
    color: #06c;
    }

    </style>

    2024-10-31 15:14

  • 靐齉齾麤龖龗

    回复 还是LZM: 没用复现你的问题。。上传一个可复现的demo吧,或者你更新一下hbx试试

    2024-10-31 15:24

  • 还是LZM (作者)

    回复 靐齉齾麤龖龗: 另外还有一个问题 :使用uni.createSelectorQuery的时候也会报错,[system] createSelectorQuery:fail

    (anonymous) @ chunk-vendors.js:69662

    Array.isArray.n.onError.length.n.onError @ chunk-vendors.js:69662

    invokeWithErrorHandling @ chunk-vendors.js:72097

    push.m44O.Vue.__call_hook @ chunk-vendors.js:78845

    o @ chunk-vendors.js:69662

    s @ chunk-vendors.js:69662

    invokeWithErrorHandling @ chunk-vendors.js:72097

    Vue.$emit @ chunk-vendors.js:74166

    a @ chunk-vendors.js:69662

    v @ chunk-vendors.js:69662

    (anonymous) @ chunk-vendors.js:69662

    insertAtCursor @ my-cueditor.vue:86

    insertTable @ my-cueditor.vue:82

    click @ index.js:33869

    invokeWithErrorHandling @ chunk-vendors.js:72097

    invoker @ chunk-vendors.js:72422

    invokeWithErrorHandling @ chunk-vendors.js:72097

    invoker @ chunk-vendors.js:72418

    original._wrapper @ chunk-vendors.js:77306

    chunk-vendors.js:70854 [Vue warn]: Error in v-on handler: "TypeError: Cannot read properties of undefined (reading '$vm')"

    2024-10-31 15:37

要回复问题请先登录注册