From 4fcfa04a9b3e7c3687d64801957c0f539edc6d18 Mon Sep 17 00:00:00 2001 From: Leopoldthecoder Date: Thu, 11 Aug 2016 11:11:59 +0800 Subject: [PATCH 1/2] relocate variable declaration --- packages/notification/src/main.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/notification/src/main.js b/packages/notification/src/main.js index a20a1b2e6..3cbdfdfd6 100644 --- a/packages/notification/src/main.js +++ b/packages/notification/src/main.js @@ -1,14 +1,14 @@ import Vue from 'vue'; -var NotificationConstructor = Vue.extend(require('./main.vue')); +let NotificationConstructor = Vue.extend(require('./main.vue')); -var instance; -var instances = []; -var seed = 1; +let instance; +let instances = []; +let seed = 1; var Notification = function(options) { options = options || {}; - var userOnClose = options.onClose; - var id = 'notification_' + seed++; + let userOnClose = options.onClose; + let id = 'notification_' + seed++; options.onClose = function() { Notification.close(id, userOnClose); @@ -23,8 +23,8 @@ var Notification = function(options) { instance.vm.visible = true; instance.dom = instance.vm.$el; - var topDist = 0; - for (var i = 0, len = instances.length; i < len; i++) { + let topDist = 0; + for (let i = 0, len = instances.length; i < len; i++) { topDist += instances[i].$el.offsetHeight + 16; } topDist += 16; @@ -33,13 +33,15 @@ var Notification = function(options) { }; Notification.close = function(id, userOnClose) { + let index; + let removedHeight; for (var i = 0, len = instances.length; i < len; i++) { if (id === instances[i].id) { if (typeof userOnClose === 'function') { userOnClose(instances[i]); } - var index = i; - var removedHeight = instances[i].dom.offsetHeight; + index = i; + removedHeight = instances[i].dom.offsetHeight; instances.splice(i, 1); break; } From c641355e4f26a79a9bde4699a0cfce7f5644c9c6 Mon Sep 17 00:00:00 2001 From: Leopoldthecoder Date: Thu, 11 Aug 2016 15:51:13 +0800 Subject: [PATCH 2/2] update input-number and slider --- examples/docs/input-number.md | 24 ++++---- examples/docs/slider.md | 37 +++++++----- packages/input-number/src/input-number.vue | 42 +++++++++----- packages/input/src/input.vue | 7 ++- packages/slider/src/main.vue | 65 +++++++++++++--------- packages/theme-default/src/slider.css | 9 +-- 6 files changed, 111 insertions(+), 73 deletions(-) diff --git a/examples/docs/input-number.md b/examples/docs/input-number.md index 75b1a94a1..4955988d1 100644 --- a/examples/docs/input-number.md +++ b/examples/docs/input-number.md @@ -21,45 +21,45 @@

当我们需要标准的数字值时可以用到这个组件,它为你提供了数值输入提供了范围控制和递增递减的步数控制。

- +
```html - + ``` ## 禁用状态
- +
```html - + ``` ## 步数
- +
```html - + ``` ## 尺寸
- - - + + +
```html - - - + + + ``` ## API diff --git a/examples/docs/slider.md b/examples/docs/slider.md index 57e9ee094..aa2375ffd 100644 --- a/examples/docs/slider.md +++ b/examples/docs/slider.md @@ -1,5 +1,16 @@