Skip to content

Commit

Permalink
feat(uni-app-x mp-weixin): 组件启用virtualHost
Browse files Browse the repository at this point in the history
  • Loading branch information
Wangyaqi committed Nov 15, 2024
1 parent 2dc4203 commit 9c4ff7d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/uni-mp-core/src/runtime/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,20 @@ export function initCreateComponent(parseOptions: ParseComponentOptions) {
rootElement?: { name: string; class: any }
}
) {
const componentOptions = parseComponent(vueComponentOptions, parseOptions)
if (__X__) {
const rootElement = vueComponentOptions.rootElement
if (rootElement) {
registerCustomElement(rootElement.name, rootElement.class)
}
if (__PLATFORM__ === 'mp-weixin') {
if (!componentOptions.options) {
componentOptions.options = {}
}
componentOptions.options.virtualHost = true
}
}
return Component(parseComponent(vueComponentOptions, parseOptions))
return Component(componentOptions)
}
}

Expand Down

0 comments on commit 9c4ff7d

Please sign in to comment.