diff --git a/examples/router/routes.js b/examples/router/routes.js index 30c8a2a..8bef3cf 100644 --- a/examples/router/routes.js +++ b/examples/router/routes.js @@ -48,6 +48,12 @@ const _components = [ meta: { title: 'Tag 标签' }, component: () => import('@/views/docs/component/tag.md'), }, + { + path: 'popup', + name: 'popup', + meta: { title: 'Popup 弹出框' }, + component: () => import('@/views/docs/component/popup.md'), + }, ] }, { diff --git a/examples/views/docs/component/popup.md b/examples/views/docs/component/popup.md new file mode 100644 index 0000000..0cc7e0c --- /dev/null +++ b/examples/views/docs/component/popup.md @@ -0,0 +1,40 @@ +# Popup 弹出框 + +参考 Mand Mobile - Popup + +## 基础用法 + +弹出框说明 + +::: snippet 示例 + +```html + + + + + +``` + +::: \ No newline at end of file diff --git a/packages/icon/index.vue b/packages/icon/index.vue index ffc7db4..0c99de1 100644 --- a/packages/icon/index.vue +++ b/packages/icon/index.vue @@ -1,5 +1,5 @@ @@ -36,6 +36,11 @@ export default { color: this.color } }, + onClick: function() { + if (this.$listeners['click']) { + this.$emit('click'); + } + } } } diff --git a/packages/popup/index.css b/packages/popup/index.css new file mode 100644 index 0000000..25d6a36 --- /dev/null +++ b/packages/popup/index.css @@ -0,0 +1,333 @@ +.zui-popup { + position: absolute; + display: flex; + pointer-events: none; + z-index: 1000; + width: 100%; + height: 100%; + top: 0; + left: 0; +} +.zui-popup.center { + align-items: center; + justify-content: center; +} +.zui-popup.top { + flex-direction: column; + justify-content: flex-start; +} +.zui-popup.top .zui-popup-box { + width: 100%; +} +.zui-popup.bottom { + flex-direction: column; + justify-content: flex-end; +} +.zui-popup.bottom .zui-popup-box { + width: 100%; +} +.zui-popup.left { + justify-content: flex-start; +} +.zui-popup.left .zui-popup-box { + height: 100%; +} +.zui-popup.right { + justify-content: flex-end; +} +.zui-popup.right .zui-popup-box { + height: 100%; +} +.zui-popup.inner-popup .zui-popup-box { + background-color: #fff; + border-radius: 4px 4px 0 0; +} +.zui-popup.large-radius.inner-popup .zui-popup-box { + border-radius: 20px 20px 0 0; +} +.zui-popup-mask { + width: 100%; + height: 100%; + position: absolute; + pointer-events: auto; + z-index: 1; + background-color: rgba(0, 0, 0, 0.7); +} +.zui-popup-box { + position: relative; + pointer-events: auto; + z-index: 2; + max-width: 100%; + max-height: 100%; + overflow: auto; +} +.zui-mask-fade-enter, +.zui-mask-fade-leave-to { + opacity: 0.01; +} +.zui-mask-fade-enter-active, +.zui-mask-fade-leave-active { + transition: opacity 250ms; +} + +.zui-bounce-enter-active { + animation: bounce-in 300ms linear; +} +.zui-bounce-leave-active { + animation: zoom-out 250ms linear; +} +.zui-zoom-enter, +.zui-zoom-leave-to { + opacity: 0.01; + transform: scale(0.75); +} +.zui-zoom-enter-active { + transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1); +} +.zui-zoom-leave-active { + transition: all 250ms linear; +} +.zui-punch-enter, +.zui-punch-leave-to { + opacity: 0.01; + transform: scale(1.35); +} +.zui-punch-enter-active { + transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1); +} +.zui-punch-leave-active { + transition: all 250ms linear; +} +.zui-slide-up-enter, +.zui-slide-up-leave-to { + transform: translate3d(0, 100%, 0); +} +.zui-slide-up-enter-active { + transition: transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1); +} +.zui-slide-up-leave-active { + transition: transform 250ms cubic-bezier(0.165, 0.84, 0.44, 1); +} +.zui-slide-right-enter, +.zui-slide-right-leave-to { + transform: translate3d(-100%, 0, 0); +} +.zui-slide-right-enter-active { + transition: transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1); +} +.zui-slide-right-leave-active { + transition: transform 250ms cubic-bezier(0.165, 0.84, 0.44, 1); +} +.zui-slide-left-enter, +.zui-slide-left-leave-to { + transform: translate3d(100%, 0, 0); +} +.zui-slide-left-enter-active { + transition: transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1); +} +.zui-slide-left-leave-active { + transition: transform 250ms cubic-bezier(0.165, 0.84, 0.44, 1); +} +.zui-slide-down-enter, +.zui-slide-down-leave-to { + transform: translate3d(0, -100%, 0); +} +.zui-slide-down-enter-active { + transition: transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1); +} +.zui-slide-down-leave-active { + transition: transform 250ms cubic-bezier(0.165, 0.84, 0.44, 1); +} +.zui-fade-enter, +.zui-fade-leave-to { + opacity: 0.01; +} +.zui-fade-enter-active { + transition: opacity 300ms cubic-bezier(0.215, 0.61, 0.355, 1); +} +.zui-fade-leave-active { + transition: opacity 250ms linear; +} +.zui-fade-up-enter, +.zui-fade-up-leave-to { + opacity: 0.01; + transform: translate3d(0, 20%, 0); +} +.zui-fade-up-enter-active { + transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1); +} +.zui-fade-up-leave-active { + transition: all 250ms linear; +} +.zui-fade-down-enter, +.zui-fade-down-leave-to { + opacity: 0.01; + transform: translate3d(0, -20%, 0); +} +.zui-fade-down-enter-active { + transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1); +} +.zui-fade-down-leave-active { + transition: all 250ms linear; +} +.zui-fade-right-enter, +.zui-fade-right-leave-to { + opacity: 0.01; + transform: translate3d(-20%, 0, 0); +} +.zui-fade-right-enter-active { + transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1); +} +.zui-fade-right-leave-active { + transition: all 250ms linear; +} +.zui-fade-left-enter, +.zui-fade-left-leave-to { + opacity: 0.01; + transform: translate3d(20%, 0, 0); +} +.zui-fade-left-enter-active { + transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1); +} +.zui-fade-left-leave-active { + transition: all 250ms linear; +} +.zui-fly-enter-active { + animation: fly-in 600ms; + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); +} +.zui-fly-leave-active { + animation: zoom-out 250ms; +} +@-moz-keyframes fly-in { + 0% { + opacity: 0.5; + transform: scale(0.5) translate3d(0, 50px, 0); + } + 45% { + opacity: 1; + transform: scale(1.05) translate3d(0, -50px, 0); + } + 100% { + transform: scale(1) translate3d(0, 0, 0); + } +} +@-webkit-keyframes fly-in { + 0% { + opacity: 0.5; + transform: scale(0.5) translate3d(0, 50px, 0); + } + 45% { + opacity: 1; + transform: scale(1.05) translate3d(0, -50px, 0); + } + 100% { + transform: scale(1) translate3d(0, 0, 0); + } +} +@-o-keyframes fly-in { + 0% { + opacity: 0.5; + transform: scale(0.5) translate3d(0, 50px, 0); + } + 45% { + opacity: 1; + transform: scale(1.05) translate3d(0, -50px, 0); + } + 100% { + transform: scale(1) translate3d(0, 0, 0); + } +} +@keyframes fly-in { + 0% { + opacity: 0.5; + transform: scale(0.5) translate3d(0, 50px, 0); + } + 45% { + opacity: 1; + transform: scale(1.05) translate3d(0, -50px, 0); + } + 100% { + transform: scale(1) translate3d(0, 0, 0); + } +} +@-moz-keyframes bounce-in { + 0% { + transform: scale(0.5); + } + 45% { + transform: scale(1.05); + } + 80% { + transform: scale(0.95); + } + 100% { + transform: scale(1); + } +} +@-webkit-keyframes bounce-in { + 0% { + transform: scale(0.5); + } + 45% { + transform: scale(1.05); + } + 80% { + transform: scale(0.95); + } + 100% { + transform: scale(1); + } +} +@-o-keyframes bounce-in { + 0% { + transform: scale(0.5); + } + 45% { + transform: scale(1.05); + } + 80% { + transform: scale(0.95); + } + 100% { + transform: scale(1); + } +} +@keyframes bounce-in { + 0% { + transform: scale(0.5); + } + 45% { + transform: scale(1.05); + } + 80% { + transform: scale(0.95); + } + 100% { + transform: scale(1); + } +} +@-moz-keyframes zoom-out { + to { + opacity: 0.01; + transform: scale(0.75); + } +} +@-webkit-keyframes zoom-out { + to { + opacity: 0.01; + transform: scale(0.75); + } +} +@-o-keyframes zoom-out { + to { + opacity: 0.01; + transform: scale(0.75); + } +} +@keyframes zoom-out { + to { + opacity: 0.01; + transform: scale(0.75); + } +} diff --git a/packages/popup/index.vue b/packages/popup/index.vue new file mode 100644 index 0000000..aeed2e0 --- /dev/null +++ b/packages/popup/index.vue @@ -0,0 +1,227 @@ + + + + + \ No newline at end of file diff --git a/packages/tag/index.vue b/packages/tag/index.vue index c9abb70..4a4ed74 100644 --- a/packages/tag/index.vue +++ b/packages/tag/index.vue @@ -1,5 +1,5 @@