提交 37db4199 编写于 作者: fxy060608's avatar fxy060608

chore(uts): 更新测试例

上级 ec4922cd
...@@ -17,7 +17,7 @@ describe('compiler: transform tap to click', () => { ...@@ -17,7 +17,7 @@ describe('compiler: transform tap to click', () => {
assert( assert(
`<button @tap="click">hello</button>`, `<button @tap="click">hello</button>`,
`createVNode(_component_button, utsMapOf({ onClick: _ctx.click }), utsMapOf({ `createVNode(_component_button, utsMapOf({ onClick: _ctx.click }), utsMapOf({
default: withCtx((): any[] => ["hello"]), default: withSlotCtx((): any[] => ["hello"]),
_: 1 /* STABLE */ _: 1 /* STABLE */
}), 8 /* PROPS */, ["onClick"])` }), 8 /* PROPS */, ["onClick"])`
) )
......
...@@ -116,7 +116,7 @@ const _component_Foo = resolveComponent("Foo") ...@@ -116,7 +116,7 @@ const _component_Foo = resolveComponent("Foo")
return createElementVNode("view", null, [ return createElementVNode("view", null, [
createVNode(_component_Foo, utsMapOf({ onClick: _ctx.test }), utsMapOf({ createVNode(_component_Foo, utsMapOf({ onClick: _ctx.test }), utsMapOf({
default: withCtx((): any[] => ["test"]), default: withSlotCtx((): any[] => ["test"]),
_: 1 /* STABLE */ _: 1 /* STABLE */
}), 8 /* PROPS */, ["onClick"]) }), 8 /* PROPS */, ["onClick"])
]) ])
...@@ -152,7 +152,7 @@ const _component_Foo = resolveComponent("Foo") ...@@ -152,7 +152,7 @@ const _component_Foo = resolveComponent("Foo")
return createElementVNode("view", null, [ return createElementVNode("view", null, [
createVNode(_component_Foo, null, utsMapOf({ createVNode(_component_Foo, null, utsMapOf({
default: withCtx((props: Map<string, any | null>): any[] => [ default: withScopedSlotCtx((props: Map<string, any | null>): any[] => [
createElementVNode("text", null, "msg: " + toDisplayString(props.msg), 1 /* TEXT */) createElementVNode("text", null, "msg: " + toDisplayString(props.msg), 1 /* TEXT */)
]), ]),
_: 1 /* STABLE */ _: 1 /* STABLE */
...@@ -176,7 +176,7 @@ const _component_Foo = resolveComponent("Foo") ...@@ -176,7 +176,7 @@ const _component_Foo = resolveComponent("Foo")
return createElementVNode("view", null, [ return createElementVNode("view", null, [
createVNode(_component_Foo, null, utsMapOf({ createVNode(_component_Foo, null, utsMapOf({
default: withCtx((props: Map<string, any | null>): any[] => [ default: withScopedSlotCtx((props: Map<string, any | null>): any[] => [
createElementVNode("text", null, "msg: " + toDisplayString(props.msg), 1 /* TEXT */) createElementVNode("text", null, "msg: " + toDisplayString(props.msg), 1 /* TEXT */)
]), ]),
_: 1 /* STABLE */ _: 1 /* STABLE */
...@@ -203,14 +203,14 @@ const _component_Foo = resolveComponent("Foo") ...@@ -203,14 +203,14 @@ const _component_Foo = resolveComponent("Foo")
</template> </template>
</Foo>`, </Foo>`,
`createVNode(_component_Foo, null, utsMapOf({ `createVNode(_component_Foo, null, utsMapOf({
default: withCtx((slotProps: Map<string, any | null>): any[] => { default: withScopedSlotCtx((slotProps: Map<string, any | null>): any[] => {
const msg = slotProps[\"msg\"] const msg = slotProps[\"msg\"]
const age = slotProps[\"age\"] const age = slotProps[\"age\"]
return [ return [
createElementVNode(\"text\", null, \"msg: \" + toDisplayString(msg), 1 /* TEXT */), createElementVNode(\"text\", null, \"msg: \" + toDisplayString(msg), 1 /* TEXT */),
createElementVNode(\"text\", null, \"age: \" + toDisplayString(age), 1 /* TEXT */) createElementVNode(\"text\", null, \"age: \" + toDisplayString(age), 1 /* TEXT */)
]}), ]}),
header: withCtx((slotProps: Map<string, any | null>): any[] => { header: withScopedSlotCtx((slotProps: Map<string, any | null>): any[] => {
const msg = slotProps[\"msg\"] const msg = slotProps[\"msg\"]
const age = slotProps[\"age\"] const age = slotProps[\"age\"]
return [ return [
...@@ -230,7 +230,7 @@ const _component_Foo = resolveComponent("Foo") ...@@ -230,7 +230,7 @@ const _component_Foo = resolveComponent("Foo")
</template> </template>
</Foo>`, </Foo>`,
`createVNode(_component_Foo, null, utsMapOf({ `createVNode(_component_Foo, null, utsMapOf({
default: withCtx((slotProps: Map<string, any | null>): any[] => [ default: withScopedSlotCtx((slotProps: Map<string, any | null>): any[] => [
createElementVNode(\"text\", null, \"default slot\") createElementVNode(\"text\", null, \"default slot\")
]), ]),
_: 1 /* STABLE */ _: 1 /* STABLE */
...@@ -245,7 +245,7 @@ const _component_Foo = resolveComponent("Foo") ...@@ -245,7 +245,7 @@ const _component_Foo = resolveComponent("Foo")
</template> </template>
</Foo>`, </Foo>`,
`createVNode(_component_Foo, null, utsMapOf({ `createVNode(_component_Foo, null, utsMapOf({
default: withCtx((slotProps: Map<string, any | null>): any[] => { default: withScopedSlotCtx((slotProps: Map<string, any | null>): any[] => {
const myMsg = slotProps[\"msg\"] const myMsg = slotProps[\"msg\"]
return [ return [
createElementVNode(\"text\", null, \"msg: \" + toDisplayString(myMsg), 1 /* TEXT */) createElementVNode(\"text\", null, \"msg: \" + toDisplayString(myMsg), 1 /* TEXT */)
...@@ -262,7 +262,7 @@ const _component_Foo = resolveComponent("Foo") ...@@ -262,7 +262,7 @@ const _component_Foo = resolveComponent("Foo")
</template> </template>
</Foo>`, </Foo>`,
`createVNode(_component_Foo, null, utsMapOf({ `createVNode(_component_Foo, null, utsMapOf({
default: withCtx((slotProps: Map<string, any | null>): any[] => { default: withScopedSlotCtx((slotProps: Map<string, any | null>): any[] => {
const msg = slotProps[\"msg\"] !== null ? slotProps[\"msg\"] : 'default msg' const msg = slotProps[\"msg\"] !== null ? slotProps[\"msg\"] : 'default msg'
return [ return [
createElementVNode(\"text\", null, \"msg: \" + toDisplayString(msg), 1 /* TEXT */) createElementVNode(\"text\", null, \"msg: \" + toDisplayString(msg), 1 /* TEXT */)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册