Browse Source

Merge branch 'v2' of https://github.com/jdf2e/nutui into v2

宋成林 6 years ago
parent
commit
c39c2bf671

+ 9 - 5
sites/doc/compents/hidden/hidden.vue

@@ -9,20 +9,19 @@
         :class="{
         :class="{
             show:isShow,
             show:isShow,
             hide:isHide
             hide:isHide
-        }" 
-        :style="siteHeight" 
-        style="transition: all .2s;">
+        }"         
+        >
         <slot></slot>        
         <slot></slot>        
     </div>
     </div>
     <div :title="titleMsg" v-if="heightSlot>400" class="bar" @click="showall">
     <div :title="titleMsg" v-if="heightSlot>400" class="bar" @click="showall">
             <svg  width="20" viewBox="0,0 20,10">
             <svg  width="20" viewBox="0,0 20,10">
                 <path v-if="isShow" d="M 0,5 
                 <path v-if="isShow" d="M 0,5 
                             L10,10 
                             L10,10 
-                            L 20,5" fill="#fff" stroke="#999">                    
+                            L 20,5" fill="none" stroke="#000">                    
                 </path>
                 </path>
                 <path v-if="!isShow" d="M 0,5 
                 <path v-if="!isShow" d="M 0,5 
                             L10,0 
                             L10,0 
-                            L 20,5" fill="#fff" stroke="#999">                    
+                            L 20,5" fill="none" stroke="#000">                    
                 </path>
                 </path>
             </svg>
             </svg>
         </div>
         </div>
@@ -70,6 +69,9 @@ export default {
 }
 }
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
+.eidt-box{
+    transition: all .5s;
+}
 .swap{
 .swap{
     position: relative;
     position: relative;
    
    
@@ -82,9 +84,11 @@ export default {
 .show{   
 .show{   
     overflow:hidden;
     overflow:hidden;
     position: relative;
     position: relative;
+     max-height: 400px;
 }
 }
 .hide{    
 .hide{    
     position: relative;
     position: relative;
+    max-height: 2000px;
 }
 }
 .bar{
 .bar{
     height: 30px;
     height: 30px;

+ 12 - 2
src/packages/col/col.vue

@@ -25,9 +25,19 @@ export default {
         span:{
         span:{
           handler(val){
           handler(val){
             if(val){
             if(val){
-                this.classObject = {
+                this.classObject = Object.assign(this.classObject,{
                     ['nut-col-'+val]:this.span == val,
                     ['nut-col-'+val]:this.span == val,
-                }
+                })
+            }
+          },
+          immediate: true
+        },
+        offset:{
+          handler(val){
+            if(val){
+                this.classObject = Object.assign(this.classObject,{
+                    ['nut-col-offset-'+val]:this.offset == val,
+                })
             }
             }
           },
           },
           immediate: true
           immediate: true

+ 0 - 1
src/packages/noticebar/noticebar.scss

@@ -1,4 +1,3 @@
-@import '../../styles/index.scss';
 .nut-noticebar {
 .nut-noticebar {
     display: flex;
     display: flex;
     height: 40px;
     height: 40px;

+ 0 - 2
src/packages/rate/rate.scss

@@ -1,5 +1,3 @@
-@import '../../styles/index.scss';
-
 @function toRGB ($color) {
 @function toRGB ($color) {
     @return "rgb("+red($color)+", "+green($color)+", "+blue($color)+")";
     @return "rgb("+red($color)+", "+green($color)+", "+blue($color)+")";
 }
 }

+ 0 - 1
src/packages/searchbar/searchbar.scss

@@ -1,4 +1,3 @@
-@import '../../styles/index.scss';
 @import "../../styles/animation/pulse";
 @import "../../styles/animation/pulse";
 .nut-searchbar {
 .nut-searchbar {
 	display: flex;
 	display: flex;

+ 20 - 2
src/packages/stepper/demo.vue

@@ -4,10 +4,10 @@
     <div>
     <div>
       <nut-cell>
       <nut-cell>
         <span slot="title">
         <span slot="title">
-          <nut-stepper :value.sync="val1" :max="12"></nut-stepper>
+          <nut-stepper @focus="focus" :blur="blur" :value.sync="val1" :max="12"></nut-stepper>
         </span>
         </span>
         <span slot="desc">
         <span slot="desc">
-          value: {{val1}} <button @click="reduce">-</button> <button @click="add">+</button> 
+          value: {{val1}} <button @click="reduce" class="demo-btn">-</button> <button @click="add" class="demo-btn">+</button> 
         </span>
         </span>
       </nut-cell>
       </nut-cell>
     </div>
     </div>
@@ -68,6 +68,12 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
+    focus(v) {
+      // console.log('focus,', v)
+    },
+    blur(v) {
+      // console.log('focus,', v)
+    },
     add() {
     add() {
       this.val1 = Number(this.val1) + 1;
       this.val1 = Number(this.val1) + 1;
     },
     },
@@ -79,4 +85,16 @@ export default {
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
+.demo-btn{
+  border: 1px solid #ddd;
+  background: #eee;
+  border-radius: 4px;
+  outline: none;
+  padding: 3px 10px;
+  cursor: pointer;
+  transition: all .35s;
+  &:hover{
+    background: #ddd;
+  }
+}
 </style>
 </style>

+ 11 - 1
src/packages/stepper/doc.md

@@ -64,4 +64,14 @@
 | step | 步长 | Number, String | 1
 | step | 步长 | Number, String | 1
 | readonly | 是否只读 | Boolean | false
 | readonly | 是否只读 | Boolean | false
 | transition | 是否需要过渡效果 | Boolean | true
 | transition | 是否需要过渡效果 | Boolean | true
-| simple | 是否显示简单版 | Boolean | true
+| simple | 是否显示简单版 | Boolean | true
+
+## Event
+
+| 字段 | 说明 | 回调参数
+|----- | ----- | -----
+| add | 点击加时触发事件 | value
+| reduce | 点击减时触发事件 | value
+| change | 值改变时触发事件 | value
+| blur | 输入框失去焦点时触发事件 | value
+| focus | 输入框获取焦点时触发事件 | value

+ 3 - 1
src/packages/stepper/stepper.vue

@@ -126,9 +126,10 @@ export default {
             this.minNum = '';
             this.minNum = '';
             // this.num = '';
             // this.num = '';
             this.focusing = true;
             this.focusing = true;
+            this.$emit('focus', this.num);
         },
         },
         blur(e) {
         blur(e) {
-            if(this.readonly) return;
+            if(this.readonly) return this.$emit('focus', this.num);
             let v = e.target.value;
             let v = e.target.value;
             this.minNum = this.min;
             this.minNum = this.min;
             this.focusing = false;
             this.focusing = false;
@@ -139,6 +140,7 @@ export default {
             }else{
             }else{
                 this.num = this.tempNum;
                 this.num = this.tempNum;
             }
             }
+            this.$emit('focus', this.num);
         },
         },
         checknum(e) {
         checknum(e) {
             let v = e.target.value;
             let v = e.target.value;