diff --git a/CHANGE.md b/CHANGE.md
index ddc25d7..ae0184a 100644
--- a/CHANGE.md
+++ b/CHANGE.md
@@ -13,4 +13,8 @@ value 改为了 label,使用 v-model,废弃 checked
### Badge
class 改为了 className
### InputNumber
-使用 v-model
\ No newline at end of file
+使用 v-model
+### Progress (名称有警告)
+新增 on-status-change 事件
+### Upload
+父级不能 computed Upload 的 fileList 了
\ No newline at end of file
diff --git a/README.md b/README.md
index 2d14427..eea0dc9 100644
--- a/README.md
+++ b/README.md
@@ -33,14 +33,14 @@
- [ ] Transfer
- [x] InputNumber
- [ ] Rate
-- [ ] Upload
+- [x] Upload
- [ ] Form
- [x] Alert
- [ ] Card
- [ ] Message
- [ ] Notice
- [ ] Modal
-- [ ] Progress
+- [x] Progress
- [x] Badge
- [ ] Collapse
- [x] Timeline
diff --git a/src/components/progress/progress.vue b/src/components/progress/progress.vue
index 16a08b3..6cc472a 100644
--- a/src/components/progress/progress.vue
+++ b/src/components/progress/progress.vue
@@ -45,13 +45,18 @@
default: 10
}
},
+ data () {
+ return {
+ currentStatus: this.status
+ }
+ },
computed: {
isStatus () {
- return this.status == 'wrong' || this.status == 'success';
+ return this.currentStatus == 'wrong' || this.currentStatus == 'success';
},
statusIcon () {
let type = '';
- switch (this.status) {
+ switch (this.currentStatus) {
case 'wrong':
type = 'ios-close';
break;
@@ -71,9 +76,9 @@
wrapClasses () {
return [
`${prefixCls}`,
- `${prefixCls}-${this.status}`,
+ `${prefixCls}-${this.currentStatus}`,
{
- [`${prefixCls}-show-info`]: !this.hideInfo,
+ [`${prefixCls}-show-info`]: !this.hideInfo
}
];
@@ -94,16 +99,18 @@
return `${prefixCls}-bg`;
}
},
- compiled () {
+ created () {
this.handleStatus();
},
methods: {
handleStatus (isDown) {
if (isDown) {
- this.status = 'normal';
+ this.currentStatus = 'normal';
+ this.$emit('on-status-change', 'normal');
} else {
if (parseInt(this.percent, 10) == 100) {
- this.status = 'success';
+ this.currentStatus = 'success';
+ this.$emit('on-status-change', 'success');
}
}
}
@@ -115,6 +122,9 @@
} else {
this.handleStatus();
}
+ },
+ status (val) {
+ this.currentStatus = val;
}
}
};
diff --git a/src/components/upload/upload-list.vue b/src/components/upload/upload-list.vue
index 9e3f48f..dce4ee8 100644
--- a/src/components/upload/upload-list.vue
+++ b/src/components/upload/upload-list.vue
@@ -11,13 +11,14 @@
type="ios-close-empty"
:class="[prefixCls + '-list-remove']"
v-show="file.status === 'finished'"
- @click="handleRemove(file)">
-
+ @click.native="handleRemove(file)">
+