组件标签的内容取出来使用:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>

</head>

<body>
<div >
    <neirong>这是组件内容
        <ul slot="s1">
            <li>aaaaaaa</li>
        </ul>



        <ol slot="s2">
            <ul>
                bbbbb
            </ul>
        </ol>

    </neirong>
</div>

<template >
    <div>
        <slot name="s2"></slot>
        <h1>sdfasf</h1>
    </div>
</template>


</body>

<script>

    new Vue({
        el: "#app",
        components:{
            'neirong':{
                template: "#neirong"
            }
        }
    })


</script>
</html>

相关文章:

  • 2021-07-22
  • 2021-05-16
  • 2022-12-23
  • 2021-09-05
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2021-05-05
  • 2022-12-23
相关资源
相似解决方案