Browse Source

Merge branch 'v3-dev' of https://github.com/jdf2e/nutui into v3-dev

guoxiaoxiao8 5 years ago
parent
commit
382d29e1fb

+ 3 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@nutui/nutui",
-  "version": "3.0.0",
+  "version": "2.5.0-beta.1",
   "description": "一套轻量级移动端Vue组件库",
   "typings": "dist/types/index.d.ts",
   "main": "dist/nutui.js",
@@ -12,6 +12,7 @@
     "CHANGELOG.md"
   ],
   "scripts": {
+    "bootstrap": "yarn || npm i",
     "dev": "nutui-cli dev",
     "build": "nutui-cli build",
     "build:site": "nutui-cli build-site",
@@ -79,7 +80,7 @@
   "devDependencies": {
     "@babel/plugin-syntax-dynamic-import": "^7.8.3",
     "@babel/plugin-transform-object-assign": "^7.8.3",
-    "@nutui/cli": "^0.2.9",
+    "@nutui/cli": "^0.3.1",
     "@typescript-eslint/eslint-plugin": "^2.16.0",
     "@typescript-eslint/parser": "^2.16.0",
     "babel-plugin-transform-object-rest-spread": "^6.26.0",

+ 5 - 3
src/packages/rate/demo.vue

@@ -23,7 +23,7 @@
     <h4>自定义尺寸</h4>
     <div>
       <nut-cell>
-        <span slot="title"><nut-rate :size="30"></nut-rate></span>
+        <span slot="title"><nut-rate :size="30" :showHalf="false"></nut-rate></span>
       </nut-cell>
     </div>
 
@@ -67,8 +67,10 @@ export default {
       result: '',
       result2: '',
       checkedColor:'#FFC200',
-      icon1: require('./../../assets/img/checked.png'),
-      icon2: require('./../../assets/img/unchecked.png')
+      icon1: `url(${require('./../../assets/img/checked.png')})`,
+      icon2: `url(${require('./../../assets/img/unchecked.png')})`
+      // icon1: `url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='rgb(255,0,0)' d='M10 20a10 10 0 1 1 0-20 10 10 0 0 1 0 20zM6.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm7 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm2.16 3H4.34a6 6 0 0 0 11.32 0z'/%3E%3C/svg%3E")`,
+      // icon2: `url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='rgb(255,0,0)' d='M10 20a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM6.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm7 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM7 13h6a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2z'/%3E%3C/svg%3E")`
     };
   },
 

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

@@ -44,4 +44,7 @@
 			color: $primary-color;
 		}
 	}
+	.fontcolor{
+		font-size: 13px;
+	}
 }

+ 13 - 3
src/packages/rate/rate.vue

@@ -11,10 +11,10 @@
         width: size + 'px',
         color:`${n <= current ? checkedColor : ''}`,
         marginRight: spacing + 'px',
-        backgroundImage: n <= current ? `url(${checkedIcon})` : `url(${uncheckedIcon})`,
+        backgroundImage: n <= current ? checkedIcon : uncheckedIcon
       }"
     >
-      <i v-if="!checkedIcon">
+      <i v-if="!checkedIcon || !uncheckedIcon">
         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path d="M18,27.4l-7.9,4.1c-0.7,0.4-1.6,0.1-2-0.6c-0.2-0.3-0.2-0.6-0.2-1l1.5-8.8l0,0
 	      L3.1,15c-0.6-0.6-0.6-1.5,0-2.1c0.2-0.2,0.5-0.4,0.9-0.4l8.8-1.3l0,0l3.9-8c0.4-0.7,1.3-1,2-0.7c0.3,0.1,0.5,0.4,0.7,0.7l3.9,8l0,0
 	      l8.8,1.3c0.8,0.1,1.4,0.9,1.3,1.7c0,0.3-0.2,0.6-0.4,0.9l-6.4,6.2l0,0l1.5,8.8c0.1,0.8-0.4,1.6-1.2,1.7c-0.3,0.1-0.7,0-1-0.2
@@ -75,7 +75,6 @@ export default {
   data() {
     return {
       current: 3,
-      defaultImage:require('./../../assets/svg/rate-default-img.svg'),
       halfStarClick:false
     };
   },
@@ -114,6 +113,17 @@ export default {
         this.$emit('click', idx-0.5);
       }
     }
+  },
+  watch: {
+    value(newVal, oldVal) {
+        if(parseInt(newVal) === parseFloat(newVal)){
+           this.current = newVal;
+        }else{
+           this.current = newVal;
+           this.showHalf = true;
+           this.halfStarClick = true;
+        }
+    }
   }
 };
 </script>

+ 7 - 0
src/packages/stepper/stepper.vue

@@ -2,6 +2,7 @@
   <div :class="{ 'nut-stepper': !simple, 'nut-stepper-simple': simple }">
     <div class="oper-wrapper reduce-wrapper" @click="reduce()"><span  :class="{ 'nut-stepper-grey': isGray }" v-html="require('../../assets/svg/reduce.svg')"> </span></div>
     <input
+      id="number"
       type="number"
       :min="minNum"
       :max="max"
@@ -129,6 +130,12 @@ export default {
   },
   methods: {
     focus(e) {
+      // conole.log(e,'e')
+      //选中选择框值
+      // const input = document.querySelector('#number');
+      // input.select();
+      // alert(1)
+      // e.currentTarget.select();
       if (this.readonly) return;
       // clear val temporary when focus, e...s
       const v = this.num;

File diff suppressed because it is too large
+ 1 - 1
src/packages/toast/toast.scss