diff --git a/src/action-sheet/README.md b/src/action-sheet/README.md index 51530f2c5..6b363d8b7 100644 --- a/src/action-sheet/README.md +++ b/src/action-sheet/README.md @@ -190,3 +190,10 @@ export default { | opened | Triggered when opened ActionSheet | - | | closed | Triggered when closed ActionSheet | - | | click-overlay | Triggered when click overlay | - | + +### Slots + +| Name | Description | +| --------------------- | ------------------ | +| default | Custom content | +| description `v2.10.4` | Custom description | diff --git a/src/action-sheet/README.zh-CN.md b/src/action-sheet/README.zh-CN.md index c18f9672b..e233fcc41 100644 --- a/src/action-sheet/README.zh-CN.md +++ b/src/action-sheet/README.zh-CN.md @@ -199,6 +199,13 @@ export default { | closed | 关闭面板且动画结束后触发 | - | | click-overlay | 点击遮罩层时触发 | - | +### Slots + +| 名称 | 说明 | +| --------------------- | -------------------- | +| default | 自定义面板的展示内容 | +| description `v2.10.4` | 自定义描述文案 | + ## 常见问题 ### 引入时提示 dependencies not found? diff --git a/src/action-sheet/index.js b/src/action-sheet/index.js index 2e15c72f1..b859dfb3f 100644 --- a/src/action-sheet/index.js +++ b/src/action-sheet/index.js @@ -102,40 +102,37 @@ export default createComponent({ ); }; + const renderDescription = () => { + if (props.description || slots.description) { + const content = slots.description + ? slots.description() + : props.description; + return