Skip to content

Commit

Permalink
fix: button, pull
Browse files Browse the repository at this point in the history
- button disable is true, prevent click emit
- pull  when refresh done,not reset loadstate
  • Loading branch information
chuanshuoye committed Mar 8, 2019
1 parent c91635f commit b6d77dd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
3 changes: 2 additions & 1 deletion example/components/pullPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@ export default {
return () => new Promise((resolve, reject) => {
this[`refreshing${index}`] = true;
setTimeout(() => {
let length = index == 1 ? this.myData1.length : this.myData2.length
let length = index == 1 ? this.myData1.length : 15;
this[`myData${index}`] = this.random(length);
resolve(true);
this[`refreshing${index}`] = false;
}, 1000)
})
},
loadData() {
console.log('loadData');
this.loading = true
return new Promise((resolve, reject) => {
setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zarm-vue",
"version": "1.4.1",
"version": "1.4.2",
"description": "zarm in vue",
"tags": [
"zarm",
Expand Down
9 changes: 3 additions & 6 deletions src/button/src/button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,11 @@ export default {
default: false,
},
},
data() {
return {
};
},
methods: {
handleClick(event) {
this.$emit('click', event);
if (!this.disabled) {
this.$emit('click', event);
}
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions src/pull/src/pull.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default {
watch: {
refreshing(val) {
const refreshState = val ? REFRESH_STATE.loading : REFRESH_STATE.normal;
this.loadState = '';
this.doRefreshAction(refreshState);
},
loading(val) {
Expand Down Expand Up @@ -147,8 +148,7 @@ export default {
}
},
onSrcoll() {
if (this.refreshState !== REFRESH_STATE.normal ||
this.loadState !== LOAD_STATE.normal) {
if (this.refreshState !== REFRESH_STATE.normal || this.loadState === LOAD_STATE.loading || this.loadState === LOAD_STATE.complete) {
return;
}
const { onLoad } = this;
Expand Down

0 comments on commit b6d77dd

Please sign in to comment.