Skip to content

Commit 552eec6

Browse files
committed
Merge branch 'v2' of https://github.com/jdf2e/nutui into v2
2 parents 315a963 + 0658967 commit 552eec6

File tree

13 files changed

+459
-299
lines changed

13 files changed

+459
-299
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 2.2.5
2+
3+
`2020-05-25`
4+
5+
* :sparkles: feat(Address):新增地址组件 @yangxiaolu1993
6+
* :sparkles: upd(Popup):优化内部代码、单元测试 @yangkaixuan
7+
* :sparkles: upd(LeftSlip):重构优化代码 #229 @vickyYE
8+
* :sparkles: upd(Video):修复自定义蒙层 @vickyYE
9+
* :sparkles: upd(Tab):优化内部代码,支持多页签滑动 @zhenyulei
10+
* :bug: fix(Range):stage 失效、控制器重叠问题 #242 @undo03
11+
* :bug: fix(CountDown):修复 startTime 异步更新问题@undo03
12+
* :bug: fix(Icon):修复 url 异步更新问题 @richard1015
13+
* :bug: fix(Swiper):修复 cdn 模式下 event 事件失效问题 @richard1015
14+
* :bug: fix(Dialog):修复标签使用时,取消按钮无效 @guoxiao158
15+
* :zap: doc:nutui-demo、user-case jdf2e 地址库更换 @richard1015
16+
* :zap: doc:补充 rate js 文档 @richard1015
17+
* :zap: doc:补充 switch demo 文档 @zjyau
18+
119
## 2.2.4
220

321
`2020-04-29`

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nutui/nutui",
3-
"version": "2.2.4",
3+
"version": "2.2.5",
44
"description": "一套轻量级移动端Vue组件库",
55
"typings": "dist/types/index.d.ts",
66
"main": "dist/nutui.js",
@@ -165,4 +165,4 @@
165165
"instrument": false,
166166
"sourceMap": false
167167
}
168-
}
168+
}

src/nutui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ import SideNavBarItem from "./packages/sidenavbaritem/index.js";
120120
import "./packages/sidenavbaritem/sidenavbaritem.scss";
121121
import Drag from "./packages/drag/index.js";
122122
import "./packages/drag/drag.scss";
123-
import VueQr from "./packages/qart/index.js";
124-
import "./packages/qart/qart.scss";
123+
// import VueQr from "./packages/qart/index.js";
124+
// import "./packages/qart/qart.scss";
125125
import Address from "./packages/address/index.js";
126126
import "./packages/address/address.scss";
127127

@@ -264,7 +264,7 @@ export default {
264264
locale,
265265
install,
266266
Lazyload,
267-
VueQr,
267+
// VueQr,
268268

269269
...components,
270270
...filters,

src/packages/elevator/elevator.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.nut-elevator{
2-
position: fixed;
2+
position:relative;
33
top:40px;
44
width: 100%;
55
}

src/packages/rate/doc.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,30 @@
4848
></nut-rate>
4949
```
5050

51+
```javascript
52+
export default {
53+
data(){
54+
return{
55+
val:4,
56+
val2:2,
57+
result:'',
58+
result2:'',
59+
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")`,
60+
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")`
61+
}
62+
},
63+
64+
methods:{
65+
onClick(idx){
66+
this.result = '您点击了第'+idx+'个!';
67+
},
68+
onClick2(idx){
69+
this.result2 = '您点击了第'+idx+'个!';
70+
}
71+
}
72+
}
73+
```
74+
5175
## Prop
5276

5377
| 字段 | 说明 | 类型 | 默认值

src/packages/switch/__test__/switch.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,4 @@ describe('Switch.vue', () => {
8383
}, 350);
8484
});
8585
});
86-
8786
});

src/packages/switch/demo.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
</div>
4444
<p>禁用状态下,change事件参数永远为初始值</p>
4545

46+
<h4>循环场景</h4>
47+
<div v-for="(item, index) of list" :key="index">
48+
<nut-cell>
49+
<span slot="title"> {{ item.name }}</span>
50+
<span slot="desc"><nut-switch @change="onChangeLabel($event,index)" :active="true"></nut-switch></span>
51+
</nut-cell>
52+
</div>
4653
<h4>自定义Class</h4>
4754
<div>
4855
<nut-cell>
@@ -56,12 +63,20 @@
5663
export default {
5764
data() {
5865
return {
59-
swActive: true
66+
swActive: true,
67+
list:[
68+
{id:'1',name:'a'},
69+
{id:'2',name:'b'},
70+
{id:'3',name:'c'}
71+
]
6072
};
6173
},
6274
methods: {
6375
onChange(status) {
6476
alert(status);
77+
},
78+
onChangeLabel(status,index){
79+
alert('status:'+status+',selected:'+index);
6580
}
6681
}
6782
};

src/packages/switch/doc.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ export default {
4949
## change事件
5050
```html
5151
<nut-switch
52-
@change="onChange"
52+
@change="onChange($event,'1')"
5353
>
5454
</nut-switch>
5555
```
5656
```javascript
5757
export default {
5858
methods: {
59-
onChange(status) {
60-
alert(status);
59+
onChange(status,index) {
60+
alert('status:'+status+',selected:'+index);
6161
}
6262
}
6363
};
@@ -85,7 +85,7 @@ export default {
8585
## Prop
8686

8787
| 字段 | 说明 | 类型 | 默认值
88-
|----- | ----- | ----- | -----
88+
|----- | ----- | ----- | -----
8989
| active | 开关状态 | Boolean | false
9090
| size | 尺寸,可选值small/base/large | String | base
91-
| disabled | 是否禁用 | Boolean | false
91+
| disabled | 是否禁用 | Boolean | false

src/packages/switch/switch.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export default {
2626
},
2727
data() {
2828
return {
29-
isActive: false,
30-
isAnimating:false
29+
isActive: false
3130
};
3231
},
3332
created() {
@@ -40,16 +39,14 @@ export default {
4039
},
4140
methods: {
4241
toggle() {
43-
if(this.isAnimating) return;
4442
const status = this.isActive;
4543
if (!this.disabled) {
4644
this.isActive = !status;
4745
}
48-
this.isAnimating = true;
46+
4947
setTimeout(() => {
5048
this.$emit("change", this.isActive);
5149
this.$emit("update:active", this.isActive);
52-
this.isAnimating = false;
5350
}, 300);
5451
}
5552
}

src/packages/tab/demo.vue

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
<nut-tab-panel tab-title="页签1">页签1</nut-tab-panel>
77
<nut-tab-panel tab-title="页签2">页签2</nut-tab-panel>
88
<nut-tab-panel tab-title="页签3">页签3</nut-tab-panel>
9+
<nut-tab-panel tab-title="页签4">页签4</nut-tab-panel>
910
</nut-tab>
11+
1012
<h4>支持导航条在上下左右位置</h4>
1113
<nut-tab @tab-switch="tabSwitch">
1214
<nut-tab-panel
@@ -35,6 +37,7 @@
3537
v-html="value.content"
3638
></nut-tab-panel>
3739
</nut-tab>
40+
3841
<nut-tab @tab-switch="tabSwitch" position-nav="bottom">
3942
<nut-tab-panel
4043
v-for="value in editableTabs"
@@ -45,10 +48,32 @@
4548
></nut-tab-panel>
4649
</nut-tab>
4750

51+
<h4>支持滑动选择多个页签</h4>
52+
<nut-tab @tab-switch="tabSwitch" :is-scroll="true">
53+
<nut-tab-panel tab-title="页签1">页签1</nut-tab-panel>
54+
<nut-tab-panel tab-title="页签2">页签2</nut-tab-panel>
55+
<nut-tab-panel tab-title="页签3">页签3</nut-tab-panel>
56+
<nut-tab-panel tab-title="页签4">页签4</nut-tab-panel>
57+
<nut-tab-panel tab-title="页签5">页签5</nut-tab-panel>
58+
<nut-tab-panel tab-title="页签6">页签6</nut-tab-panel>
59+
<nut-tab-panel tab-title="页签7">页签7</nut-tab-panel>
60+
</nut-tab>
61+
62+
<h4>支持滑动选择多个页签</h4>
63+
<nut-tab @tab-switch="tabSwitch" :is-scroll="true" position-nav="left">
64+
<nut-tab-panel tab-title="页签1">页签1</nut-tab-panel>
65+
<nut-tab-panel tab-title="页签2">页签2</nut-tab-panel>
66+
<nut-tab-panel tab-title="页签3">页签3</nut-tab-panel>
67+
<nut-tab-panel tab-title="页签4">页签4</nut-tab-panel>
68+
<nut-tab-panel tab-title="页签5">页签5</nut-tab-panel>
69+
<nut-tab-panel tab-title="页签6">页签6</nut-tab-panel>
70+
<nut-tab-panel tab-title="页签7">页签7</nut-tab-panel>
71+
</nut-tab>
72+
4873
<h4>禁止选中,默认选中某个标签</h4>
4974
<h4>如需要更新页面,请将监听变化的数据传入init-data</h4>
5075

51-
<nut-tab :def-index="defIndex" class="customer-css" @tab-switch="tabSwitch" :contentShow="true" :init-data="disableTabs">
76+
<nut-tab :def-index="defIndex" class="customer-css" @tab-switch="tabSwitch" :contentShow="true" :init-data="disableTabs" :is-show-line="false">
5277
<nut-tab-panel
5378
v-for="value in disableTabs"
5479
v-bind:key="value.tabTitle"
@@ -210,6 +235,8 @@ export default {
210235
.nut-tab-active {
211236
background: $primary-color;
212237
border: 0;
238+
transition: all 0.3s ease-in-out;
239+
213240
}
214241
.nav-bar {
215242
background: $primary-color;

src/packages/tab/doc.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,31 @@ export default {
7575
}
7676
};
7777
```
78+
## 支持滑动选择多个页签
79+
80+
```html
81+
<nut-tab @tab-switch="tabSwitch" :is-scroll="true">
82+
<nut-tab-panel tab-title="页签1">页签1</nut-tab-panel>
83+
<nut-tab-panel tab-title="页签2">页签2</nut-tab-panel>
84+
<nut-tab-panel tab-title="页签3">页签3</nut-tab-panel>
85+
<nut-tab-panel tab-title="页签4">页签4</nut-tab-panel>
86+
<nut-tab-panel tab-title="页签5">页签5</nut-tab-panel>
87+
<nut-tab-panel tab-title="页签6">页签6</nut-tab-panel>
88+
<nut-tab-panel tab-title="页签7">页签7</nut-tab-panel>
89+
</nut-tab>
90+
```
91+
92+
```html
93+
<nut-tab @tab-switch="tabSwitch" :is-scroll="true" position-nav="left">
94+
<nut-tab-panel tab-title="页签1">页签1</nut-tab-panel>
95+
<nut-tab-panel tab-title="页签2">页签2</nut-tab-panel>
96+
<nut-tab-panel tab-title="页签3">页签3</nut-tab-panel>
97+
<nut-tab-panel tab-title="页签4">页签4</nut-tab-panel>
98+
<nut-tab-panel tab-title="页签5">页签5</nut-tab-panel>
99+
<nut-tab-panel tab-title="页签6">页签6</nut-tab-panel>
100+
<nut-tab-panel tab-title="页签7">页签7</nut-tab-panel>
101+
</nut-tab>
102+
```
78103

79104
## 禁止选中,默认选中某个标签,如需更新数组后,重新渲染Tab页面,请将更新数组传入init-data
80105

@@ -202,8 +227,8 @@ export default {
202227
| position-nav | 页签栏的分布,可选值 top/bottom/left/right | String | top
203228
| def-index | 默认选中的页签栏 | String | 1
204229
| init-data | 监听数据变化,渲染更新页面 | Array | []
205-
| is-show-line|是否显示tab切换时的红条|true|
206-
230+
| is-show-line|是否显示tab切换时的红条|Boolean|true|
231+
| is-scroll|是否支持滑动选择多个页签|Boolean|false|
207232

208233
### nut-tab-panel
209234

0 commit comments

Comments
 (0)