breaking change: rename get-container to teleport

This commit is contained in:
chenjiahan
2020-08-21 10:58:02 +08:00
parent 07d1a2590f
commit 52b187692b
39 changed files with 154 additions and 127 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ export default {
| close-on-popstate | Whether to close when popstate | _boolean_ | `true` |
| close-on-click-overlay | Whether to close when click overlay | _boolean_ | `true` |
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | _boolean_ | `true` |
| get-container | Return the mount node for ShareSheet | _string \| () => Element_ | - |
| teleport | Return the mount node for ShareSheet | _string \| Element_ | - |
### Data Structure of Option
+1 -1
View File
@@ -169,7 +169,7 @@ export default {
| close-on-popstate | 是否在页面回退时自动关闭 | _boolean_ | `true` |
| close-on-click-overlay | 是否在点击遮罩层后关闭 | _boolean_ | `true` |
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | _boolean_ | `true` |
| get-container | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| () => Element_ | - |
| teleport | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| Element_ | - |
### Option 数据结构
+2 -2
View File
@@ -13,9 +13,9 @@ export default createComponent({
...popupSharedProps,
title: String,
duration: [Number, String],
teleport: [String, Object],
cancelText: String,
description: String,
getContainer: [String, Function],
options: {
type: Array,
default: () => [],
@@ -141,7 +141,7 @@ export default createComponent({
duration={this.duration}
lazyRender={this.lazyRender}
lockScroll={this.lockScroll}
getContainer={this.getContainer}
teleport={this.teleport}
closeOnPopstate={this.closeOnPopstate}
closeOnClickOverlay={this.closeOnClickOverlay}
safeAreaInsetBottom={this.safeAreaInsetBottom}
+1 -1
View File
@@ -89,7 +89,7 @@ test('click-overlay event', async () => {
const wrapper = mount(ShareSheet, {
propsData: {
value: true,
getContainer: () => root,
teleport: root,
},
});