Skip to content
This repository has been archived by the owner on Aug 8, 2022. It is now read-only.

bug: 组件自闭合会导致后面的内容无法显示 #735

Closed
xld1393679430 opened this issue Sep 15, 2021 · 1 comment
Closed

bug: 组件自闭合会导致后面的内容无法显示 #735

xld1393679430 opened this issue Sep 15, 2021 · 1 comment

Comments

@xld1393679430
Copy link

如下代码 当组件自闭合会导致后面的内容无法显示, 换成有结束标签的话后面内容就可以显示了, 麻烦大佬看下

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue3</title>
    <script src="http://unpkg.com/vue@next"></script>
</head>

<body>
    <div id="root">
        <!-- 自闭合后面的内容不显示 -->
        <child-one  />

        <!-- 有结束标签后面的内容可以显示 -->
        <!-- <child-one></child-one> -->

        <p>hello</p>
    </div>
</body>
<script>
    const ChildOne = {
        template: `
            <div>
                child-one: <input type="text" />
            </div>
        `
    }

    Vue.createApp({
        components: {
            'child-one': ChildOne
        },
    }).mount('#root')
</script>

</html>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant