feat(sfc): ::slotted selector support

This commit is contained in:
Evan You
2019-12-16 16:45:10 -05:00
parent 69c9dbc825
commit f194aa0eea
2 changed files with 24 additions and 20 deletions

View File

@@ -384,13 +384,15 @@ export function createRenderer<
}
// scopeId
if (__BUNDLER__ && scopeId !== null) {
hostSetScopeId(el, scopeId)
if (__BUNDLER__) {
if (scopeId !== null) {
hostSetScopeId(el, scopeId)
}
const treeOwnerId = parentComponent && parentComponent.type.__scopeId
// vnode's own scopeId and the current patched component's scopeId is
// different - this is a slot content node.
if (treeOwnerId != null && treeOwnerId !== scopeId) {
hostSetScopeId(el, treeOwnerId + '::slot')
hostSetScopeId(el, treeOwnerId + '-s')
}
}