-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for JSX and strings without a slot-scope attribute #871
Conversation
I think it is necessary to change document. |
`the scopedSlots option does not support PhantomJS. ` + | ||
`Please use Puppeteer, or pass a component.` | ||
) | ||
} | ||
if (vueVersion < 2.5) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If template tag in scopedSlots mounting options works normally,
I think this limitation is not necessary.
I added this limitation since template tag in scopedSlots mounting options did not work.
https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots
In 2.5.0+, slot-scope is no longer limited to the element, but can instead be used on any element or component in the slot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you can add to either a tag or any other tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
Since vueVersion < 2.5
limitation is not necessary, validateEnvironment()
is not necessary.
vueVersion < 2.5
limitation is not necessary, vueVersion < 2.1
limitation is necessary.
New in 2.1.0+
) | ||
} | ||
} | ||
const scopedSlotRe = /<[^>]+ slot-scope=\"(.+)\"/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, I think slotScopeRe
is better.
if (vueVersion < 2.5) { | ||
throwError(`the scopedSlots option is only supported in ` + `vue@2.5+.`) | ||
if (vueVersion < 2.1) { | ||
throwError(`the scopedSlots option is only supported in ` + `vue@2.1+.`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the scopedSlots option is only supported in
+ [email protected]+.
↓
the scopedSlots option is only supported in [email protected]+.
scopedSlots[name] = function (props) { | ||
if (isDestructuring) { | ||
return render.call({ ...helpers, ...props }) | ||
for (const s in scopedSlotsOption) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think slotName
is better then s
.
cc @38elements
Closes #657