[Improvement] eslint: use vue-libs (#1237)

This commit is contained in:
neverland
2018-06-07 11:59:02 +08:00
committed by GitHub
parent 5b7542b8f0
commit a1c5c6fef4
27 changed files with 222 additions and 344 deletions
+2 -2
View File
@@ -60,11 +60,11 @@ export default {
methods: {
onClick(item) {
Toast(item.name);
this.$toast(item.name);
},
handleCancel() {
Toast('cancel');
this.$toast('cancel');
}
}
};
+2 -2
View File
@@ -54,11 +54,11 @@ export default {
methods: {
onSave() {
Toast('save');
this.$toast('save');
},
onDelete() {
Toast('delete');
this.$toast('delete');
},
onChangeDetail(val) {
+2 -2
View File
@@ -72,10 +72,10 @@ export default {
methods: {
onAdd() {
Toast(this.$t('add'));
this.$toast(this.$t('add'));
},
onEdit(item, index) {
Toast(this.$t('edit') + ':' + index);
this.$toast(this.$t('edit') + ':' + index);
}
}
};
+1 -1
View File
@@ -55,7 +55,7 @@ export default {
instance.close();
break;
case 'right':
Dialog.confirm({
this.$dialog.confirm({
message: this.$t('confirm')
}).then(() => {
instance.close();
+1 -1
View File
@@ -109,7 +109,7 @@ export default {
this.chosenCoupon = index;
},
onExchange(code) {
Toast(this.$t('exchange'));
this.$toast(this.$t('exchange'));
this.exchangedCoupons.push({
...this.coupon,
id: this.randomId()
+3 -3
View File
@@ -57,20 +57,20 @@ export default {
methods: {
onClickAlert() {
Dialog.alert({
this.$dialog.alert({
title: this.$t('title'),
message: this.$t('content')
});
},
onClickAlert2() {
Dialog.alert({
this.$dialog.alert({
message: this.$t('content')
});
},
onClickConfirm() {
Dialog.confirm({
this.$dialog.confirm({
title: this.$t('title'),
message: this.$t('content')
});
+2 -2
View File
@@ -48,11 +48,11 @@ export default {
methods: {
onClickMiniBtn() {
Toast(this.$t('clickIcon'));
this.$toast(this.$t('clickIcon'));
},
onClickBigBtn() {
Toast(this.$t('clickButton'));
this.$toast(this.$t('clickButton'));
}
}
};
+1 -1
View File
@@ -1,7 +1,7 @@
<template>
<div :class="b([type, color])" :style="style">
<span :class="b('spinner', type)">
<i v-for="item in (type === 'spinner' ? 12 : 0)" />
<i v-for="(item, index) in (type === 'spinner' ? 12 : 0)" :key="index" />
<svg v-if="type === 'circular'" :class="b('circular')" viewBox="25 25 50 50">
<circle cx="50" cy="50" r="20" fill="none"/>
</svg>
+2 -2
View File
@@ -23,10 +23,10 @@
export default {
methods: {
onClickLeft() {
Toast(this.$t('back'));
this.$toast(this.$t('back'));
},
onClickRight() {
Toast(this.$t('button'));
this.$toast(this.$t('button'));
}
}
};
+2 -2
View File
@@ -60,10 +60,10 @@ export default {
methods: {
onInput(value) {
Toast('Input: ' + value);
this.$toast('Input: ' + value);
},
onDelete() {
Toast('Delete');
this.$toast('Delete');
}
}
};
+1 -1
View File
@@ -19,7 +19,7 @@
</div>
<div :class="b('body')">
<key
v-for="(key, index) in keys"
v-for="key in keys"
:key="key.text"
:text="key.text"
:type="key.type"
+1 -1
View File
@@ -9,7 +9,7 @@
</li>
<li
v-if="isMultiMode"
v-for="(page, index) in pages"
v-for="page in pages"
class="van-hairline"
:class="[b('item', { active: page.active }), b('page')]"
@click="selectPage(page.number)"
+3 -3
View File
@@ -86,16 +86,16 @@ export default {
methods: {
onChange1(picker, value, index) {
Toast(this.$t('toastContent', value, index));
this.$toast(this.$t('toastContent', value, index));
},
onChange2(picker, values) {
picker.setColumnValues(1, this.$t('column3')[values[0]]);
},
onConfirm(value, index) {
Toast(this.$t('toastContent', value, index));
this.$toast(this.$t('toastContent', value, index));
},
onCancel() {
Toast(this.$t('cancel'));
this.$toast(this.$t('cancel'));
}
}
};
+1 -1
View File
@@ -81,7 +81,7 @@ export default {
methods: {
showDialog() {
Dialog.confirm({
this.$dialog.confirm({
title: 'confirm标题',
message: '弹窗提示文字,左右始终距离边20PX,上下距离20PX,文字左对齐。弹窗提示文字,左右始终距离边20PX,上下距离20PX,文字左对齐。'
});
+1 -1
View File
@@ -31,7 +31,7 @@ export default {
methods: {
onRefresh() {
setTimeout(() => {
Toast(this.$t('success'));
this.$toast(this.$t('success'));
this.isLoading = false;
this.count++;
}, 500);
+2 -2
View File
@@ -51,10 +51,10 @@ export default {
methods: {
onSearch() {
Toast(this.value);
this.$toast(this.value);
},
onCancel() {
Toast(this.$t('cancel'));
this.$toast(this.$t('cancel'));
}
}
};
+1 -1
View File
@@ -21,7 +21,7 @@
<div class="van-clearfix" v-if="paddingImg || imgList.length > 0">
<!-- 已有的图片,图片右上角显示删除按钮 -->
<div
v-for="(img, index) in imgList"
v-for="img in imgList"
:class="b('img')"
>
<img :src="img">
+6 -6
View File
@@ -115,12 +115,12 @@ export default {
const { action, limitType, quota } = data;
if (action === 'minus') {
Toast('至少选择一件商品');
this.$toast('至少选择一件商品');
} else if (action === 'plus') {
if (limitType === LIMIT_TYPE.QUOTA_LIMIT) {
Toast(`限购${quota}`);
this.$toast(`限购${quota}`);
} else {
Toast('库存不够了~~');
this.$toast('库存不够了~~');
}
}
}
@@ -138,15 +138,15 @@ export default {
methods: {
onBuyClicked(data) {
Toast(JSON.stringify(data));
this.$toast(JSON.stringify(data));
},
onAddCartClicked(data) {
Toast(JSON.stringify(data));
this.$toast(JSON.stringify(data));
},
onPointClicked() {
Toast('积分兑换');
this.$toast('积分兑换');
}
}
};
+2 -2
View File
@@ -73,10 +73,10 @@ export default {
methods: {
onClickButton() {
Toast(this.$t('clickButton'));
this.$toast(this.$t('clickButton'));
},
onClickLink() {
Toast(this.$t('clickLink'));
this.$toast(this.$t('clickLink'));
}
}
};
+1 -1
View File
@@ -40,7 +40,7 @@ export default {
methods: {
onInput(checked) {
Dialog.confirm({
this.$dialog.confirm({
title: this.$t('title'),
message: this.$t('message')
}).then(() => {
+6 -6
View File
@@ -49,23 +49,23 @@ export default {
methods: {
showToast() {
Toast(this.$t('text1'));
this.$toast(this.$t('text1'));
},
showLoadingToast() {
Toast.loading({ mask: true, message: this.$t('loading') + '...' });
this.$toast.loading({ mask: true, message: this.$t('loading') + '...' });
},
showSuccessToast() {
Toast.success(this.$t('text2'));
this.$toast.success(this.$t('text2'));
},
showFailToast() {
Toast.fail(this.$t('text3'));
this.$toast.fail(this.$t('text3'));
},
showCustomizedToast(duration) {
const toast = Toast.loading({
const toast = this.$toast.loading({
duration: 0,
forbidClick: true,
loadingType: 'spinner',
@@ -79,7 +79,7 @@ export default {
toast.message = this.$t('text4', second);
} else {
clearInterval(timer);
Toast.clear();
this.$toast.clear();
}
}, 1000);
}