diff --git a/docs/examples-dist/actionsheet.vue b/docs/examples-dist/actionsheet.vue new file mode 100644 index 000000000..84cfb5cbd --- /dev/null +++ b/docs/examples-dist/actionsheet.vue @@ -0,0 +1,72 @@ + + + \ No newline at end of file diff --git a/docs/examples-dist/popup.vue b/docs/examples-dist/popup.vue index db9be2d11..e928446d9 100644 --- a/docs/examples-dist/popup.vue +++ b/docs/examples-dist/popup.vue @@ -3,7 +3,7 @@ 从下方弹出popup - xxxx + 从中间弹出popup
@@ -23,8 +23,8 @@
从中间弹出popup
- - 一些内容 + + 从中间弹出popup @@ -33,6 +33,13 @@ + + + +## ActionSheet + +### 基础用法 + +:::demo 基础用法 +```html +
+ 弹出actionsheet +
+ + +``` +::: + +### 带取消按钮的ActionSheet + +:::demo 带取消按钮的ActionSheet +```html +
+ 弹出带取消按钮的actionsheet +
+ + +``` +::: + +### 带标题的ActionSheet + +:::demo 带标题的ActionSheet +```html +
+ 弹出带标题的actionsheet +
+ +

一些内容

+
+``` +::: diff --git a/docs/nav.config.json b/docs/nav.config.json index 4abfcb2a5..83bf82ac3 100644 --- a/docs/nav.config.json +++ b/docs/nav.config.json @@ -89,6 +89,10 @@ { "groupName": "JS组件", "list": [ + { + "path": "/actionsheet", + "title": "ActionSheet" + }, { "path": "/tab", "title": "Tab" diff --git a/packages/actionsheet/src/actionsheet.vue b/packages/actionsheet/src/actionsheet.vue index d40fc9c92..1039d00b4 100644 --- a/packages/actionsheet/src/actionsheet.vue +++ b/packages/actionsheet/src/actionsheet.vue @@ -1,28 +1,54 @@ diff --git a/packages/zanui-css/src/actionsheet.css b/packages/zanui-css/src/actionsheet.css index b6e2bd368..2d6921693 100644 --- a/packages/zanui-css/src/actionsheet.css +++ b/packages/zanui-css/src/actionsheet.css @@ -1,9 +1,81 @@ +@import './common/var.css'; +@import './mixins/border_retina.css'; + @component-namespace zan { @b actionsheet { + position: fixed; + width: 100%; + top: auto; + bottom: 0; + right: auto; + left: 50%; + transform: translate3d(-50%, 0, 0); + backface-visibility: hidden; + transition: .2s ease-out; + background-color: #e0e0e0; + + @m withtitle { + background-color: $c-white; + } + + @e item { + line-height: 50px; + text-align: center; + color: $c-black; + font-size: 16px; + position: relative; + background-color: $c-white; + + @m loading { + padding: 10px 0; + } + + &::after { + @mixin border-retina (top); + } + } + + @e subname { + color: $c-gray-darker; + font-size: 12px; + } + + @e loading { + margin: 0 auto; + } + + @e button { + display: block; + margin-top: 5px; + line-height: 50px; + color: $c-black; + font-size: 16px; + text-align: center; + background-color: $c-white; + } + + @e header { + line-height: 44px; + color: $c-black; + text-align: center; + position: relative; + + &::after { + @mixin border-retina (top, bottom); + } + + .zan-icon-close { + position: absolute; + font-size: 22px; + line-height: 22px; + top: 11px; + right: 15px; + } + } } } -.actionsheet-float-bottom-enter, -.actionsheet-float-bottom-leave-active { +.actionsheet-float-enter, +.actionsheet-float-leave-active { transform: translate3d(-50%, 100%, 0); }