From 49921f55fadc1e23db1770b9d87acd26ff612a7c Mon Sep 17 00:00:00 2001 From: dolymood Date: Wed, 6 Jun 2018 15:57:53 +0800 Subject: [PATCH] chore(Popup): position and mask-closable demo --- example/pages/popup.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/example/pages/popup.vue b/example/pages/popup.vue index ce9850ca..29d3ae81 100644 --- a/example/pages/popup.vue +++ b/example/pages/popup.vue @@ -14,8 +14,8 @@ Show Popup - with content
- My Popup Content 4 - Show Popup - bottom + My Popup Content 4 + top/right/bottom/left/center
@@ -30,6 +30,8 @@ import CubePage from '../components/cube-page.vue' import CubeExtendPopup from '../components/extend-popup.vue' + const positions = ['top', 'right', 'bottom', 'left', 'center'] + let cur = 0 export default { data() { return { @@ -38,15 +40,22 @@ visible1: false, visible2: false, visible3: false, - visible4: false + visible4: false, + position: '' } }, methods: { showPopup(i) { + if (i === 4) { + this.position = positions[cur++] + if (cur === positions.length) { + cur = 0 + } + } this['visible' + i] = true setTimeout(() => { this['visible' + i] = false - }, 1000) + }, 2000) } }, components: { -- GitLab