From 17b9eadcb0d87a061c0b1eacd8883df5c8f68620 Mon Sep 17 00:00:00 2001 From: landluck Date: Mon, 27 Feb 2023 11:23:46 +0800 Subject: [PATCH] feat(popup): add root-portal prop support (#5254) * feat(popup): add root-portal prop support * fix(popup): fix test case error --------- Co-authored-by: liuhaihonggia --- .../test/__snapshots__/demo.spec.ts.snap | 6 +++++ .../test/__snapshots__/demo.spec.ts.snap | 1 + .../test/__snapshots__/demo.spec.ts.snap | 4 ++++ .../test/__snapshots__/demo.spec.ts.snap | 2 ++ packages/popup/README.md | 1 + packages/popup/index.ts | 4 ++++ packages/popup/index.wxml | 23 ++++++++----------- packages/popup/popup.wxml | 14 +++++++++++ .../test/__snapshots__/demo.spec.ts.snap | 9 ++++++++ .../test/__snapshots__/demo.spec.ts.snap | 4 ++++ .../test/__snapshots__/demo.spec.ts.snap | 1 + .../test/__snapshots__/demo.spec.ts.snap | 1 + 12 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 packages/popup/popup.wxml diff --git a/packages/action-sheet/test/__snapshots__/demo.spec.ts.snap b/packages/action-sheet/test/__snapshots__/demo.spec.ts.snap index 138de9f7..94db079b 100644 --- a/packages/action-sheet/test/__snapshots__/demo.spec.ts.snap +++ b/packages/action-sheet/test/__snapshots__/demo.spec.ts.snap @@ -55,6 +55,7 @@ exports[`should render demo and match snapshot 1`] = ` bind:close="onClickOverlay" > = `2.25.2 ` | _boolean_ | `false` | ### Events diff --git a/packages/popup/index.ts b/packages/popup/index.ts index fef1f49b..a4b2f71d 100644 --- a/packages/popup/index.ts +++ b/packages/popup/index.ts @@ -64,6 +64,10 @@ VantComponent({ type: Boolean, value: true, }, + rootPortal: { + type: Boolean, + value: false, + }, }, created() { diff --git a/packages/popup/index.wxml b/packages/popup/index.wxml index fad03082..ab824b15 100644 --- a/packages/popup/index.wxml +++ b/packages/popup/index.wxml @@ -1,6 +1,8 @@ + + - - - - + + + + + + diff --git a/packages/popup/popup.wxml b/packages/popup/popup.wxml new file mode 100644 index 00000000..25b57fe1 --- /dev/null +++ b/packages/popup/popup.wxml @@ -0,0 +1,14 @@ + + + + diff --git a/packages/popup/test/__snapshots__/demo.spec.ts.snap b/packages/popup/test/__snapshots__/demo.spec.ts.snap index a56a4456..7f6048de 100644 --- a/packages/popup/test/__snapshots__/demo.spec.ts.snap +++ b/packages/popup/test/__snapshots__/demo.spec.ts.snap @@ -46,6 +46,7 @@ exports[`should render demo and match snapshot 1`] = ` bind:close="hideBasic" >