Skip to content

JSX $scopedSlots support #657

Closed
Closed
@panganibanpj

Description

@panganibanpj

What problem does this feature solve?

Being able to use $scopedSlots with render function (specifically for JSX usage)

shallowMount({
    render() {
        return this.$scopedSlots.foo({ bar: 'baz' });
    },
}, {
    scopedSlots: {
        foo: '<div>{{ bar }}</div>',
    },
})

It will complain that $scopedSlots.foo is not a function, but if you make it a function, it will say $scopedSlots.foo.trim() is not a function

What does the proposed API look like?

I prefer if scopedSlots can be passed function values like:

scopedSlots: {
  foo: (createElement, props) => { return createElement('div', props); },
},

Otherwise, at least make it so the above syntax would still work (with string scopedSlot.foo values but the this.$scopedSlots.foo() in the render function still work)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions