After some research I found that this is not possible by default. I was able to achieve this using custom render functions.
child-slot component - this one needs to be placed inside parent slot content, it enables you to format content of child component. You can add more than one child-slot to mix it with parent content. It needs to define ref attribute with distinct value.
use-slot component - this one is used to tell what content should be passed to parent as child-slot content. Content will be placed inside span element. It needs named and container attributes.
named - name of slot to place content in
container - ref value of child-slot
use-slot will automatically find first parent slot named by named attribute regardless of child depth
child-slot
<script> export default { render(createElement) { return createElement('span', {}, this.content); }, data() { return { nodesToRender: {} } }, computed: { content() { var result = []; for (var node in this.nodesToRender) { result = result.concat(this.nodesToRender[node] || []); } return result; } } } </script>
use-slot
<script> export default { abstract: true, props: { named: { type: String, required: true }, container: { type: String, required: true } }, render() { var parent = this.findParentOfSlot(); var content = this.$slots.default; var self = this; this.$parent.$nextTick(function () { if (parent && parent.$refs && parent.$refs[self.container], parent.$refs[self.container].nodesToRender) { Vue.set(parent.$refs[self.container].nodesToRender, self.$vnode.tag, content); } }); }, methods: { findParentOfSlot() { var parent = this.$parent; while (parent) { if (parent.$slots && parent.$slots[this.named]) { return parent.$parent; } parent = parent.$parent; } return parent; } } } </script>
step1-stateandstep2-statecomponents use themodaldirectly and then just use adivor something as the wrapper inwizard?