DS
Size: a a a
DS
DS
R
this.$emit('myEvent', eventProps)
в родителе пишем <component @v-on:myEvent="handlerFn" />
DS
R
V💊
button @click="setComponent"
component :is="componentName"
components: {
'MyComponent' => import('./MyComponent')
}
setComponent(){
this.componentName = 'MyComponent'
// и вот тут я хочу вызвать метод компонета через ref, но компонент с тому времени не загрузился или не смонтировался
// помогает только this.nextTick
this.$refs.MyComponent.method()
}
СМ
СМ
R
СМ
V💊
R
СМ
СМ
V💊
button @click="setComponent"
component :is="componentName"
components: {
'MyComponent' => import('./MyComponent')
}
setComponent(){
this.componentName = 'MyComponent'
// и вот тут я хочу вызвать метод компонета через ref, но компонент с тому времени не загрузился или не смонтировался
// помогает только this.nextTick
this.$refs.MyComponent.method()
}
R
R
R
R
R