-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Description
Version
2.4.4
Reproduction link
https://jsfiddle.net/57508hba/4/
Steps to reproduce
- Create a component with a slot
- Bind a reference to a string to the slot via
v-bind
- Utilize said component and define a template for the defined slot, giving it a local scope parameter with which to output the bound string.
- Output the scoped string in your template which is passed to the component created in step 1
What is expected?
The string bound to the slot should be passed into the template passed for the slot, as a string.
What is actually happening?
The string is being exploded into an object where the properties are the string indexes for each character in the string.
I'm not sure if this is intended behavior or not. The default value for the defined slot outputs the string as expected, but as soon as it's passed to the consumer defined template, the string is altered to an object.
The temporary work-around for this is to simply pass an actual object to v-bind on the slot, and expect an object as the scoped value in your defined template.
It seems that if this is intended behavior, there should be at least a Vue warning about the value being mangled and that v-bind expects an object and not string.