[Improvement] eslint: use vue-libs (#1237)
This commit is contained in:
@@ -60,11 +60,11 @@ export default {
|
||||
|
||||
methods: {
|
||||
onClick(item) {
|
||||
Toast(item.name);
|
||||
this.$toast(item.name);
|
||||
},
|
||||
|
||||
handleCancel() {
|
||||
Toast('cancel');
|
||||
this.$toast('cancel');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -54,11 +54,11 @@ export default {
|
||||
|
||||
methods: {
|
||||
onSave() {
|
||||
Toast('save');
|
||||
this.$toast('save');
|
||||
},
|
||||
|
||||
onDelete() {
|
||||
Toast('delete');
|
||||
this.$toast('delete');
|
||||
},
|
||||
|
||||
onChangeDetail(val) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
instance.close();
|
||||
break;
|
||||
case 'right':
|
||||
Dialog.confirm({
|
||||
this.$dialog.confirm({
|
||||
message: this.$t('confirm')
|
||||
}).then(() => {
|
||||
instance.close();
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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')
|
||||
});
|
||||
|
||||
@@ -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,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>
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -60,10 +60,10 @@ export default {
|
||||
|
||||
methods: {
|
||||
onInput(value) {
|
||||
Toast('Input: ' + value);
|
||||
this.$toast('Input: ' + value);
|
||||
},
|
||||
onDelete() {
|
||||
Toast('Delete');
|
||||
this.$toast('Delete');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)"
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
showDialog() {
|
||||
Dialog.confirm({
|
||||
this.$dialog.confirm({
|
||||
title: 'confirm标题',
|
||||
message: '弹窗提示文字,左右始终距离边20PX,上下距离20PX,文字左对齐。弹窗提示文字,左右始终距离边20PX,上下距离20PX,文字左对齐。'
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ export default {
|
||||
methods: {
|
||||
onRefresh() {
|
||||
setTimeout(() => {
|
||||
Toast(this.$t('success'));
|
||||
this.$toast(this.$t('success'));
|
||||
this.isLoading = false;
|
||||
this.count++;
|
||||
}, 500);
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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('积分兑换');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
onInput(checked) {
|
||||
Dialog.confirm({
|
||||
this.$dialog.confirm({
|
||||
title: this.$t('title'),
|
||||
message: this.$t('message')
|
||||
}).then(() => {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user