From 43693fa781777022c31504b09924b388423a14ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Fri, 25 Aug 2017 15:37:39 +0800 Subject: [PATCH 1/3] Dialog: support both function call and component call --- docs/examples-docs/dialog.md | 95 ++++++++++++++-------------- packages/dialog/dialog.vue | 49 ++++++++++----- packages/dialog/index.js | 105 +++++++++++-------------------- packages/vant-css/src/button.css | 1 - packages/vant-css/src/dialog.css | 10 ++- test/unit/specs/dialog.spec.js | 23 +++---- 6 files changed, 131 insertions(+), 152 deletions(-) diff --git a/docs/examples-docs/dialog.md b/docs/examples-docs/dialog.md index a40704c8c..cb71eacc0 100644 --- a/docs/examples-docs/dialog.md +++ b/docs/examples-docs/dialog.md @@ -9,33 +9,29 @@ diff --git a/packages/cell-swipe/index.vue b/packages/cell-swipe/index.vue index 7c1b87dde..7ab4ce705 100644 --- a/packages/cell-swipe/index.vue +++ b/packages/cell-swipe/index.vue @@ -51,7 +51,7 @@ export default { wrapperStyle() { return { transform: `translate3d(${this.offset}px, 0, 0)` - } + }; } }, @@ -72,9 +72,8 @@ export default { if (direction > 0 && -offset > rightWidth * 0.4 && rightWidth > 0) { this.swipeMove(-rightWidth); this.resetSwipeStatus(); - } // left - else if (direction < 0 && offset >leftWidth * 0.4 && leftWidth > 0) { + } else if (direction < 0 && offset > leftWidth * 0.4 && leftWidth > 0) { this.swipeMove(leftWidth); this.resetSwipeStatus(); } else { @@ -114,7 +113,7 @@ export default { endDrag() { if (this.swiping) { - this.swipeLeaveTransition(this.offset > 0 ? -1 : 1); + this.swipeLeaveTransition(this.offset > 0 ? -1 : 1); }; } } diff --git a/packages/datetime-picker/index.vue b/packages/datetime-picker/index.vue index 75d521a17..c89cc77ff 100644 --- a/packages/datetime-picker/index.vue +++ b/packages/datetime-picker/index.vue @@ -19,7 +19,7 @@ export default { name: 'van-datetime-picker', components: { - 'van-picker': Picker + [Picker.name]: Picker }, props: { diff --git a/packages/field/index.vue b/packages/field/index.vue index 2f86df5b1..67145aa67 100644 --- a/packages/field/index.vue +++ b/packages/field/index.vue @@ -48,15 +48,15 @@