Skip to content

Scoped slots (slot-scope) issues #178

@viktorlarsson

Description

@viktorlarsson

Currently scoped slots in our project, but we have come across when having multiple slots on the same component.

This is an example we are using it at the moment:

vuecomponent.vue

<template>
    <span><slot name="test"></slot></span>
    <button><slot name="test"></slot></button>
</template>

test.html

<vuecomponent>
    <template slot="test" slot-scope="multiple">Testing</template>
</vuecomponent>

vuecomponent.spec.ts

import Vuecomponent from '@/components/vuecomponent.vue';

const test= Vue.component('test', {
   template: `<span>testtest</span>`,
});
const comp = mount(Vuecomponent, {
   slots: {
        'add-button': mount(test),
    },
});

And when we are mounting it using Avoriaz, the following issue is presented in the console:

[Vue warn]: Duplicate presence of slot "test" found in the same render tree - this will likely cause render errors.

Can't find any way on how to define the slot-scope. Is it possible to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions