提交 20e52bc2 编写于 作者: fxy060608's avatar fxy060608

chore(mp): fallback => fallbackContent

上级 04078639
......@@ -24,7 +24,11 @@ export interface MiniProgramCompilerOptions {
/**
* 是否支持后备内容
*/
fallback?: boolean
fallbackContent?: boolean
/**
* 是否支持动态插槽名
*/
dynamicSlotNames?: boolean
}
filter?: {
lang: string
......
......@@ -188,7 +188,8 @@ const miniProgram = {
slot: {
$slots: true,
// 支付宝 fallback 有 bug,当多个带默认 slot 组件嵌套使用时,所有的默认slot均会显示,如uni-file-picker(image)
fallback: false,
fallbackContent: false,
dynamicSlotNames: true,
},
directive: 'a:',
};
......
......@@ -26,7 +26,8 @@ export const miniProgram: MiniProgramCompilerOptions = {
slot: {
$slots: true,
// 支付宝 fallback 有 bug,当多个带默认 slot 组件嵌套使用时,所有的默认slot均会显示,如uni-file-picker(image)
fallback: false,
fallbackContent: false,
dynamicSlotNames: true,
},
directive: 'a:',
}
......
......@@ -155,7 +155,8 @@ const miniProgram = {
array: true,
},
slot: {
fallback: true,
fallbackContent: true,
dynamicSlotNames: false,
},
directive: 's-',
};
......
......@@ -23,7 +23,8 @@ export const miniProgram: MiniProgramCompilerOptions = {
array: true,
},
slot: {
fallback: true,
fallbackContent: true,
dynamicSlotNames: false,
},
directive: 's-',
}
......
......@@ -4,7 +4,7 @@ const options = {
miniProgram: {
...miniProgram,
slot: {
fallback: true,
fallbackContent: true,
},
},
}
......
......@@ -8,7 +8,8 @@ export const miniProgram: MiniProgramCompilerOptions = {
array: true,
},
slot: {
fallback: false,
fallbackContent: false,
dynamicSlotNames: true,
},
directive: 'wx:',
} as const
......
......@@ -124,7 +124,7 @@ function genVFor(
function genSlot(node: SlotOutletNode, context: TemplateCodegenContext) {
// 移除掉所有非name属性,即移除作用域插槽的绑定指令
node.props = node.props.filter((prop) => prop.name === 'name')
if (!node.children.length || context.slot.fallback) {
if (!node.children.length || context.slot.fallbackContent) {
// 无后备内容或支持后备内容
return genElement(node, context)
}
......
......@@ -257,7 +257,8 @@ export function createTransformContext(
array: true,
},
slot: {
fallback: false,
fallbackContent: false,
dynamicSlotNames: true,
},
directive: '',
},
......
......@@ -98,7 +98,8 @@ const miniProgram = {
array: true,
},
slot: {
fallback: false,
fallbackContent: false,
dynamicSlotNames: true,
},
directive: 'qq:',
};
......
......@@ -28,7 +28,8 @@ export const miniProgram: MiniProgramCompilerOptions = {
array: true,
},
slot: {
fallback: false,
fallbackContent: false,
dynamicSlotNames: true,
},
directive: 'qq:',
}
......
......@@ -35,7 +35,8 @@ const miniProgram = {
array: false,
},
slot: {
fallback: true,
fallbackContent: true,
dynamicSlotNames: true,
},
directive: 'tt:',
};
......
......@@ -31,7 +31,8 @@ export const miniProgram: MiniProgramCompilerOptions = {
array: false,
},
slot: {
fallback: true,
fallbackContent: true,
dynamicSlotNames: true,
},
directive: 'tt:',
}
......
......@@ -72,7 +72,8 @@ const miniProgram = {
array: true,
},
slot: {
fallback: false,
fallbackContent: false,
dynamicSlotNames: true,
},
directive: 'wx:',
};
......
......@@ -29,7 +29,8 @@ export const miniProgram: MiniProgramCompilerOptions = {
array: true,
},
slot: {
fallback: false,
fallbackContent: false,
dynamicSlotNames: true,
},
directive: 'wx:',
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册