About vue slot issu

div id= "app" >

    <child slot="head">
        <!-- 

miqi

--> i am head </child> <child slot="foot"> i am foot </child> </div> <script src="./vue.js"></script> <script> Vue.component("child",{ props: ["content"], template: `<div> <slot name="head"></slot>

hellow

<slot></slot> <slot name="foot"></slot> </div>` }) var vm = new Vue({ el: "-sharpapp" }) </script>

hellow


because there are two child components above, each child has a

hello

element. You can check

with vue devtools.

clipboard.png


it is right to appear on both sides according to your way of writing, and the usage you want is like this:

<child>
  <div slot="head">I am head</div>
  <div slot="foot">I am head</div>
  
</child>
Menu