浏览代码

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

杨磊 7 年之前
父节点
当前提交
ece9eb2d65

+ 11 - 11
build/webpack.demo.base.conf.js

@@ -22,17 +22,17 @@ module.exports = merge(webpackBaseConf, {
     module: {
     module: {
         rules: [
         rules: [
             //自定义主题
             //自定义主题
-            {
-                test: /\.(sa|sc|c)ss$/,
-                use: [
-                    {
-                        loader: 'sass-loader',
-                        options: {
-                            data: `@import "./sites/demo/asset/css/custom.scss";@import "./src/styles/index.scss"; `,
-                        },
-                    }
-                ],
-            }
+            // {
+            //     test: /\.(sa|sc|c)ss$/,
+            //     use: [
+            //         {
+            //             loader: 'sass-loader',
+            //             options: {
+            //                 data: `@import "./sites/demo/asset/css/custom.scss";@import "./src/styles/index.scss"; `,
+            //             },
+            //         }
+            //     ],
+            // }
         ]
         ]
     },
     },
     plugins: [
     plugins: [

+ 2 - 1
sites/demo/app.js

@@ -1,4 +1,3 @@
-//import 'babel-polyfill';
 import "core-js/modules/es6.promise";
 import "core-js/modules/es6.promise";
 import "core-js/modules/es6.array.iterator";
 import "core-js/modules/es6.array.iterator";
 import Vue from 'vue';
 import Vue from 'vue';
@@ -8,6 +7,8 @@ import Conf from '../../src/config.json';
 import NutUI from '../../src/nutui';
 import NutUI from '../../src/nutui';
 // import en from '../../src/locales/lang/en-US';
 // import en from '../../src/locales/lang/en-US';
 // import demoEN from './lang/en-US';
 // import demoEN from './lang/en-US';
+
+
 import './asset/css/common.scss';
 import './asset/css/common.scss';
 
 
 import './asset/img/logo_share.png';
 import './asset/img/logo_share.png';

+ 1 - 1
sites/demo/index.html

@@ -7,7 +7,7 @@
   <link rel="shortcut icon" href="/favicon.ico">
   <link rel="shortcut icon" href="/favicon.ico">
   <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
   <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
   <title>NutUI - 移动端Vue组件库</title>
   <title>NutUI - 移动端Vue组件库</title>
-  <script src="//misc.360buyimg.com/felibs/vue/2.5.16/vue.min.js"></script>
+  <!-- <script src="//misc.360buyimg.com/felibs/vue/2.5.16/vue.min.js"></script> -->
   <script src="https://h5.m.jd.com/babelDiy/Zeus/2846ykuM7PwipD9E2RzMj2BGEQpA/plugin/share.min.js"></script>
   <script src="https://h5.m.jd.com/babelDiy/Zeus/2846ykuM7PwipD9E2RzMj2BGEQpA/plugin/share.min.js"></script>
   <!-- <script src="//misc.360buyimg.com/felibs/fastclick/1.0.6/fastclick.min.js"></script> -->
   <!-- <script src="//misc.360buyimg.com/felibs/fastclick/1.0.6/fastclick.min.js"></script> -->
   <style>
   <style>

+ 3 - 3
src/packages/actionsheet/actionsheet.vue

@@ -11,11 +11,11 @@
                 v-show="isVisible"
                 v-show="isVisible"
             >
             >
                 <div class="nut-actionsheet-custom"  v-if="$slots.custom">
                 <div class="nut-actionsheet-custom"  v-if="$slots.custom">
-                    <slot name="custom">{{custom}}</slot>
+                    <slot name="custom" v-html="custom"></slot>
                 </div>
                 </div>
                 <dl class="nut-actionsheet-modal" v-if="$slots.title || $slots.subTitle ">
                 <dl class="nut-actionsheet-modal" v-if="$slots.title || $slots.subTitle ">
-                    <dt class="nut-actionsheet-title"><slot name="title">{{title}}</slot></dt>
-                    <dd class="nut-actionsheet-sub-title"><slot name="sub-title">{{subTitle}}</slot></dd>
+                    <dt class="nut-actionsheet-title"><slot name="title" v-html="title"></slot></dt>
+                    <dd class="nut-actionsheet-sub-title"><slot name="sub-title" v-html="subTitle"></slot></dd>
                 </dl>
                 </dl>
                 <ul class="nut-actionsheet-menu" >
                 <ul class="nut-actionsheet-menu" >
                     <li class="nut-actionsheet-item" 
                     <li class="nut-actionsheet-item" 

+ 1 - 1
src/packages/badge/badge.vue

@@ -15,7 +15,7 @@ export default {
   name: 'nut-badge',
   name: 'nut-badge',
   props: {
   props: {
     value: {
     value: {
-      type: String
+      type: [String,Number]
     },
     },
     max: {
     max: {
       type: Number,
       type: Number,

+ 2 - 2
src/packages/calendar/calendar.scss

@@ -36,10 +36,10 @@
         line-height: 40px;
         line-height: 40px;
     }
     }
     .nut-calendar-confirm-btn{
     .nut-calendar-confirm-btn{
-        right: 0;
+        left: 0;
     }
     }
     .nut-calendar-cancel-btn{
     .nut-calendar-cancel-btn{
-        left: 0;
+        right: 0;
     }
     }
     .nut-calendar-title{
     .nut-calendar-title{
         margin: 0 60px;
         margin: 0 60px;

+ 3 - 3
src/packages/calendar/calendar.vue

@@ -2,7 +2,7 @@
     <transition :name="animation">
     <transition :name="animation">
         <div class="nut-calendar" v-show="isVisible">
         <div class="nut-calendar" v-show="isVisible">
             <div class="nut-calendar-control">
             <div class="nut-calendar-control">
-                <span class="nut-calendar-confirm-btn" @click="confirm" v-if="(type == 'change' && currDate && currDate.length == 2) || type != 'change'">{{nutTranslate('lang.okBtnTxt')}}</span>
+                <span class="nut-calendar-confirm-btn" @click="confirm" v-if="(type == 'range' && currDate && currDate.length == 2) || type != 'range'">{{nutTranslate('lang.okBtnTxt')}}</span>
                 <span class="nut-calendar-cancel-btn"  @click="closeActionSheet">{{nutTranslate('lang.cancelText')}}</span>
                 <span class="nut-calendar-cancel-btn"  @click="closeActionSheet">{{nutTranslate('lang.cancelText')}}</span>
                 <div class="nut-calendar-title">{{title || nutTranslate('lang.calendar.title')}}</div>
                 <div class="nut-calendar-title">{{title || nutTranslate('lang.calendar.title')}}</div>
                 <div class="nut-calendar-week">
                 <div class="nut-calendar-week">
@@ -44,7 +44,7 @@ export default {
         },
         },
         animation: {
         animation: {
             type: String,
             type: String,
-            default: 'nutSlideRight'
+            default: 'nutSlideUp'
         },
         },
         isAutoBackFill: {
         isAutoBackFill: {
             type: Boolean,
             type: Boolean,
@@ -162,7 +162,7 @@ export default {
                     this.monthsData.push(monthInfo);
                     this.monthsData.push(monthInfo);
                 } else {
                 } else {
                     this.unLoadNext = true;
                     this.unLoadNext = true;
-                }
+                }   
             } else {
             } else {
                 if (!this.startData || Utils.compareDate(`${this.startData[0]}-${this.startData[1]}-01`,`${curData[0]}-${curData[1]}-${curData[2]}`)) {
                 if (!this.startData || Utils.compareDate(`${this.startData[0]}-${this.startData[1]}-01`,`${curData[0]}-${curData[1]}-${curData[2]}`)) {
                     this.monthsData.unshift(monthInfo);
                     this.monthsData.unshift(monthInfo);

+ 1 - 1
src/packages/cell/index.js

@@ -5,4 +5,4 @@ Cell.install = function(Vue) {
   Vue.component(Cell.name, Cell);
   Vue.component(Cell.name, Cell);
 };
 };
 
 
-export default Cell
+export default Cell;

+ 2 - 2
src/packages/col/index.js

@@ -3,6 +3,6 @@ import './col.scss';
 
 
 Col.install = function(Vue) {
 Col.install = function(Vue) {
     Vue.component(Col.name, Col);
     Vue.component(Col.name, Col);
-}
+};
 
 
-export default Col
+export default Col;

+ 2 - 1
src/packages/flex/index.js

@@ -4,6 +4,7 @@ import './flex.scss';
 Row.install = function(Vue) {
 Row.install = function(Vue) {
   Vue.component(Flex.name, Row);
   Vue.component(Flex.name, Row);
 };
 };
+
 Col.install = function(Vue) {
 Col.install = function(Vue) {
   Vue.component(Flex.name, Col);
   Vue.component(Flex.name, Col);
 };
 };
@@ -11,4 +12,4 @@ Col.install = function(Vue) {
 export default {
 export default {
 	Row,
 	Row,
 	Col
 	Col
-}
+};

+ 7 - 5
src/packages/imagepicker/__test__/imagepicker.spec.js

@@ -8,8 +8,8 @@ describe('ImagePicker.vue',() => {
     });
     });
 
 
     it('点击删除图片',() => {
     it('点击删除图片',() => {
-        wrapper.setProps({
-            imgList:[{
+        wrapper.setData({
+            list:[{
                 id:1,
                 id:1,
                 src:"//img1.360buyimg.com/da/jfs/t1/4436/26/9691/78074/5bad0668E7ce89ec6/c234b749ae9e7332.jpg"
                 src:"//img1.360buyimg.com/da/jfs/t1/4436/26/9691/78074/5bad0668E7ce89ec6/c234b749ae9e7332.jpg"
             }]
             }]
@@ -21,11 +21,13 @@ describe('ImagePicker.vue',() => {
     });
     });
 
 
     it('允许上传最多1张',() => {
     it('允许上传最多1张',() => {
-        wrapper.setProps({
-            imgList:[{
+        wrapper.setData({
+            list:[{
                 id:1,
                 id:1,
                 src:"//img1.360buyimg.com/da/jfs/t1/4436/26/9691/78074/5bad0668E7ce89ec6/c234b749ae9e7332.jpg"
                 src:"//img1.360buyimg.com/da/jfs/t1/4436/26/9691/78074/5bad0668E7ce89ec6/c234b749ae9e7332.jpg"
-            }],
+            }]
+        });
+        wrapper.setProps({
             max:1
             max:1
         });
         });
 
 

+ 1 - 1
src/packages/noticebar/demo.vue

@@ -5,7 +5,7 @@
       <h4>禁用滚动</h4>
       <h4>禁用滚动</h4>
       <nut-noticebar text="华为畅享9新品即将上市,活动期间0元预约可参与抽奖,赢HUAWEI WATCH等好礼,更多产品信息请持续关注!" :scrollable="false"></nut-noticebar>
       <nut-noticebar text="华为畅享9新品即将上市,活动期间0元预约可参与抽奖,赢HUAWEI WATCH等好礼,更多产品信息请持续关注!" :scrollable="false"></nut-noticebar>
       <h4>通告栏模式--关闭模式</h4>
       <h4>通告栏模式--关闭模式</h4>
-      <nut-noticebar mode="true" @click="hello">华为畅享9新品即将上市,活动期间0元预约可参与抽奖,赢HUAWEI WATCH等好礼,更多产品信息请持续关注!</nut-noticebar>
+      <nut-noticebar :mode="true" @click="hello">华为畅享9新品即将上市,活动期间0元预约可参与抽奖,赢HUAWEI WATCH等好礼,更多产品信息请持续关注!</nut-noticebar>
       <h4>通告栏模式--链接模式</h4>
       <h4>通告栏模式--链接模式</h4>
       <nut-noticebar
       <nut-noticebar
         text="华为畅享9新品即将上市,活动期间0元预约可参与抽奖,赢HUAWEI WATCH等好礼,更多产品信息请持续关注!"
         text="华为畅享9新品即将上市,活动期间0元预约可参与抽奖,赢HUAWEI WATCH等好礼,更多产品信息请持续关注!"

+ 1 - 1
src/packages/progress/progress.vue

@@ -11,7 +11,7 @@
                      {{percentage}}%
                      {{percentage}}%
                 </template>
                 </template>
                 <template v-else-if="status=='success' || 'wrong'">
                 <template v-else-if="status=='success' || 'wrong'">
-                    <icon :class="statusIcon"></icon>
+                    <i :class="statusIcon"></i>
                 </template>
                 </template>
             </slot>
             </slot>
         </div>
         </div>

+ 3 - 3
src/packages/range/range.vue

@@ -10,7 +10,7 @@
 								background: mainColor
 								background: mainColor
 							}">
 							}">
 						</div>
 						</div>
-            <Movebar 
+            <nut-range-bar 
                 :initLeft="initLeft1" 
                 :initLeft="initLeft1" 
                 @getPos="getPosLeft"
                 @getPos="getPosLeft"
                 :showLabelAlways="showLabelAlways"
                 :showLabelAlways="showLabelAlways"
@@ -18,7 +18,7 @@
                 :current="currentLeft"
                 :current="currentLeft"
                 :ani.sync="ani"
                 :ani.sync="ani"
 								:mainColor="mainColor"/>
 								:mainColor="mainColor"/>
-            <Movebar 
+            <nut-range-bar 
                 :initLeft="initLeft2" 
                 :initLeft="initLeft2" 
                 @getPos="getPosRight"
                 @getPos="getPosRight"
                 :showLabelAlways="showLabelAlways"
                 :showLabelAlways="showLabelAlways"
@@ -51,7 +51,7 @@ function toRGBA(c, opacity) {
 export default {
 export default {
   name: "nut-range",
   name: "nut-range",
   components: {
   components: {
-    Movebar
+    [Movebar.name]: Movebar
   },
   },
   props: {
   props: {
     rangeValues: {
     rangeValues: {

文件差异内容过多而无法显示
+ 1 - 0
src/packages/rating/rating.scss


+ 2 - 2
src/packages/stepper/doc.md

@@ -56,10 +56,10 @@
 
 
 | 字段 | 说明 | 类型 | 默认值 
 | 字段 | 说明 | 类型 | 默认值 
 | ----- | ----- | ----- | ----- 
 | ----- | ----- | ----- | ----- 
-| init | 初始值 | Number | 1
+| init | 初始值 | Number, String | 1
 | min | 最小值 | Number, String | 0
 | min | 最小值 | Number, String | 0
 | max | 最大值 | Number, String | Infinity
 | max | 最大值 | Number, String | Infinity
-| step | 步长 | Number | 1
+| step | 步长 | Number, String | 1
 | readonly | 是否只读 | Boolean | false
 | readonly | 是否只读 | Boolean | false
 | transition | 是否需要过渡效果 | Boolean | true
 | transition | 是否需要过渡效果 | Boolean | true
 | simple | 是否显示简单版 | Boolean | true
 | simple | 是否显示简单版 | Boolean | true

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

@@ -48,7 +48,7 @@ export default {
             default: true,
             default: true,
         },
         },
         init: {
         init: {
-            type: Number,
+            type: [Number, String],
             default: 1,
             default: 1,
         },
         },
         min: {
         min: {
@@ -60,7 +60,7 @@ export default {
             default: Infinity,
             default: Infinity,
         },
         },
         step: {
         step: {
-            type: Number,
+            type: [Number, String],
             default: 1
             default: 1
         },
         },
         readonly: {
         readonly: {

+ 0 - 2
src/packages/swiper/swiper.vue

@@ -305,9 +305,7 @@ export default {
             let requestAniFrame = this._requestAniFrame();
             let requestAniFrame = this._requestAniFrame();
             let imgLazyLoadEl;
             let imgLazyLoadEl;
             requestAniFrame(()=>{
             requestAniFrame(()=>{
-                console.log(232323);
                 imgLazyLoadEl = this.swiperWrap.querySelectorAll('.nut-img-lazyload');
                 imgLazyLoadEl = this.swiperWrap.querySelectorAll('.nut-img-lazyload');
-                console.log(imgLazyLoadEl);
                 if(type == 1){
                 if(type == 1){
                     imgLazyLoadEl = this.slideEls[this.currentPage - 1].querySelectorAll('.nut-img-lazyload');
                     imgLazyLoadEl = this.slideEls[this.currentPage - 1].querySelectorAll('.nut-img-lazyload');
                 }
                 }