Skip to content

Commit 14148a8

Browse files
committed
wip(x): 页面不支持使用 :host
1 parent f043cf6 commit 14148a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/uni-mp-alipay/src/compiler/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
5252
},
5353
directive: 'a:',
5454
component: {
55-
// 支付宝小程序支持 :host 选择器
55+
// 只有组件支持 :host 选择器,还需开启 virtualHost: false (https://opendocs.alipay.com/mini/framework/component-template#%3Ahost%20%E9%80%89%E6%8B%A9%E5%99%A8)
5656
':host': true,
5757
dir: COMPONENTS_DIR,
5858
getPropertySync: true,

packages/uni-mp-vite/src/plugin/configResolved.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export function createConfigResolved({
150150
const flexDirection = parseUniXFlexDirection(
151151
parseManifestJsonOnce(process.env.UNI_INPUT_DIR)
152152
)
153-
cssCode = `:host{display:flex;flex-direction:${flexDirection}}\n${cssCode}`
153+
cssCode = `:host,page{display:flex;flex-direction:${flexDirection}}\n${cssCode}`
154154
}
155155

156156
if (!isMiniProgramPageFile(filename)) {

0 commit comments

Comments
 (0)