Skip to content

vue3问题 #418

@zairl23

Description

@zairl23

使用vue3.2, 如下的template编译报错:

<template>
    <div class="flex items-center">
        <div>
            <div :style="{ width: '30%' }">手机号</div>
            <div :style="{ width: '70%' }">xxx</div>
        </div>
        <div>
            <div :style="{ width: '30%' }">手机号</div>
            <div :style="{ width: '70%' }">xxx</div>
        </div>
    </div>
</template>

错误:

VM28 WAService.js:2 TypeError: Cannot read property 'cloneNode' of undefined
at insertStaticContent。。。

这样注释一个div, 可通过:

<template>
    <div class="flex items-center">
        <div>
            <div :style="{ width: '30%' }">手机号</div>
            <div :style="{ width: '70%' }">xxx</div>
        </div>
        <div>
            <div :style="{ width: '30%' }">手机号</div>
            <!--<div :style="{ width: '70%' }">xxx</div>-->
        </div>
    </div>
</template>

改部分div 为 wx-view 也可以通过:

<template>
    <!-- <Nav title="编辑地址"></Nav> -->
    <div class="flex items-center">
        <div>
            <div :style="{ width: '30%' }">手机号</div>
            <div :style="{ width: '70%' }">xxx</div>
        </div>
        <div>
            <wx-view :style="{ width: '30%' }">手机号</wx-view>
            <wx-view :style="{ width: '70%' }">xxx</wx-view>
        </div>
    </div>
</template>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions