chore: prettier source code

This commit is contained in:
chenjiahan
2020-04-02 15:36:02 +08:00
parent 340c56b3b5
commit 2fb5cca49a
93 changed files with 272 additions and 283 deletions
+2 -2
View File
@@ -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
View File
@@ -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 {