add two warns

pull/5440/head
Leopoldthecoder 2017-06-18 17:48:18 +08:00 committed by 杨奕
parent 64f80f51a7
commit 601bd6469b
2 changed files with 10 additions and 0 deletions

View File

@ -52,6 +52,11 @@
},
methods: {
resetFields() {
if (!this.model) {
process.env.NODE_ENV !== 'production' &&
console.warn('[Element Warn][Form]model is required for resetFields to work.');
return;
}
this.fields.forEach(field => {
field.resetField();
});

View File

@ -237,6 +237,11 @@
},
stops() {
if (this.step === 0) {
process.env.NODE_ENV !== 'production' &&
console.warn('[Element Warn][Slider]step should not be 0.');
return [];
}
const stopCount = (this.max - this.min) / this.step;
const stepWidth = 100 * this.step / (this.max - this.min);
const result = [];