chore: prettier source code
This commit is contained in:
@@ -69,7 +69,7 @@ export default {
|
||||
text3: '失败文案',
|
||||
customIcon: '自定义图标',
|
||||
customImage: '展示图片',
|
||||
text4: second => `倒计时 ${second} 秒`,
|
||||
text4: (second) => `倒计时 ${second} 秒`,
|
||||
longTextButton: '长文字提示',
|
||||
updateMessage: '动态更新提示',
|
||||
loadingType: '自定义加载图标',
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
text3: 'Fail',
|
||||
customIcon: 'Custom Icon',
|
||||
customImage: 'Custom Image',
|
||||
text4: second => `${second} seconds`,
|
||||
text4: (second) => `${second} seconds`,
|
||||
longTextButton: 'Long Text',
|
||||
updateMessage: 'Update Message',
|
||||
loadingType: 'Loading Type',
|
||||
|
||||
+7
-7
@@ -54,7 +54,7 @@ function createInstance() {
|
||||
el: document.createElement('div'),
|
||||
});
|
||||
|
||||
toast.$on('input', value => {
|
||||
toast.$on('input', (value) => {
|
||||
toast.value = value;
|
||||
});
|
||||
|
||||
@@ -99,7 +99,7 @@ function Toast(options = {}) {
|
||||
if (multiple && !isServer) {
|
||||
toast.$on('closed', () => {
|
||||
clearTimeout(toast.timer);
|
||||
queue = queue.filter(item => item !== toast);
|
||||
queue = queue.filter((item) => item !== toast);
|
||||
|
||||
removeNode(toast.$el);
|
||||
toast.$destroy();
|
||||
@@ -119,20 +119,20 @@ function Toast(options = {}) {
|
||||
return toast;
|
||||
}
|
||||
|
||||
const createMethod = type => options =>
|
||||
const createMethod = (type) => (options) =>
|
||||
Toast({
|
||||
type,
|
||||
...parseOptions(options),
|
||||
});
|
||||
|
||||
['loading', 'success', 'fail'].forEach(method => {
|
||||
['loading', 'success', 'fail'].forEach((method) => {
|
||||
Toast[method] = createMethod(method);
|
||||
});
|
||||
|
||||
Toast.clear = all => {
|
||||
Toast.clear = (all) => {
|
||||
if (queue.length) {
|
||||
if (all) {
|
||||
queue.forEach(toast => {
|
||||
queue.forEach((toast) => {
|
||||
toast.clear();
|
||||
});
|
||||
queue = [];
|
||||
@@ -152,7 +152,7 @@ Toast.setDefaultOptions = (type, options) => {
|
||||
}
|
||||
};
|
||||
|
||||
Toast.resetDefaultOptions = type => {
|
||||
Toast.resetDefaultOptions = (type) => {
|
||||
if (typeof type === 'string') {
|
||||
defaultOptionsMap[type] = null;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user