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
@@ -166,7 +166,7 @@ export default {
| close-on-click-action | Whether to close when click action | _boolean_ | `false` |
| 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 ActionSheet | _string \| () => Element_ | - |
| teleport | Return the mount node for ActionSheet | _string \| Element_ | - |
### Data Structure of Action
+1 -1
View File
@@ -172,7 +172,7 @@ export default {
| close-on-click-action | 是否在点击选项后关闭 | _boolean_ | `false` |
| 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_ | - |
### Action 数据结构
+2 -2
View File
@@ -14,9 +14,9 @@ export default createComponent({
title: String,
actions: Array,
duration: [Number, String],
teleport: [String, Object],
cancelText: String,
description: String,
getContainer: [String, Function],
closeOnPopstate: Boolean,
closeOnClickAction: Boolean,
round: {
@@ -163,7 +163,7 @@ export default createComponent({
duration={props.duration}
lazyRender={props.lazyRender}
lockScroll={props.lockScroll}
getContainer={props.getContainer}
teleport={props.teleport}
closeOnPopstate={props.closeOnPopstate}
closeOnClickOverlay={props.closeOnClickOverlay}
safeAreaInsetBottom={props.safeAreaInsetBottom}
+3 -3
View File
@@ -51,7 +51,7 @@ test('click overlay and close', async () => {
<div>
<action-sheet
:value="true"
:get-container="getContainer"
:teleport="teleport"
@input="onInput"
@click-overlay="onClickOverlay"
/>
@@ -62,7 +62,7 @@ test('click overlay and close', async () => {
},
data() {
return {
getContainer: () => div,
teleport: () => div,
};
},
methods: {
@@ -110,7 +110,7 @@ test('get container', () => {
const wrapper = mount(ActionSheet, {
propsData: {
value: true,
getContainer: 'body',
teleport: 'body',
},
});