m0ksem / vue-ce-slot-provide-issue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ce-slot-provide-issue

main.ts

import { defineCustomElement } from 'vue'

import ChildComp from './components/ChildComp.vue'
import ParentComp from './components/ParentComp.vue'

const ceChild = defineCustomElement(ChildComp)
const ceParent = defineCustomElement(ParentComp)

customElements.define('child-comp', ceChild)
customElements.define('parent-comp', ceParent)

index.html

<script type="module" src="/src/main.ts"></script>

<parent-comp>
    <child-comp>

    </child-comp>      
</parent-comp>

Issue: parent component renders after child, so child component can not accept anything from parent.provides in inject fn.

About


Languages

Language:TypeScript 41.4%Language:Vue 35.7%Language:HTML 22.9%