mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
chore: bump eslint config and format code (#9223)
This commit is contained in:
parent
9e55e28a43
commit
c34c629ba3
@ -219,8 +219,8 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
// parse output columns data
|
||||
const parseValues = (values: AreaColumnOption[]) => {
|
||||
return values.map((value, index) => {
|
||||
const parseValues = (values: AreaColumnOption[]) =>
|
||||
values.map((value, index) => {
|
||||
if (value) {
|
||||
value = deepClone(value);
|
||||
|
||||
@ -232,7 +232,6 @@ export default defineComponent({
|
||||
|
||||
return value;
|
||||
});
|
||||
};
|
||||
|
||||
const getValues = () => {
|
||||
if (pickerRef.value) {
|
||||
|
@ -241,14 +241,12 @@ export default defineComponent({
|
||||
/>
|
||||
);
|
||||
|
||||
const renderDays = () => {
|
||||
return (
|
||||
<div ref={daysRef} role="grid" class={bem('days')}>
|
||||
{renderMark()}
|
||||
{(shouldRender.value ? days : placeholders).value.map(renderDay)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const renderDays = () => (
|
||||
<div ref={daysRef} role="grid" class={bem('days')}>
|
||||
{renderMark()}
|
||||
{(shouldRender.value ? days : placeholders).value.map(renderDay)}
|
||||
</div>
|
||||
);
|
||||
|
||||
useExpose({
|
||||
getTitle,
|
||||
|
@ -190,8 +190,8 @@ export default defineComponent({
|
||||
);
|
||||
};
|
||||
|
||||
const renderKeys = () => {
|
||||
return keys.value.map((key) => {
|
||||
const renderKeys = () =>
|
||||
keys.value.map((key) => {
|
||||
const keySlots: Record<string, Slot | undefined> = {};
|
||||
|
||||
if (key.type === 'delete') {
|
||||
@ -213,7 +213,6 @@ export default defineComponent({
|
||||
/>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const renderSidebar = () => {
|
||||
if (props.theme === 'custom') {
|
||||
|
@ -112,8 +112,8 @@ export default defineComponent({
|
||||
const wrapperRef = ref<HTMLElement>();
|
||||
const popoverRef = ref<ComponentInstance>();
|
||||
|
||||
const createPopperInstance = () => {
|
||||
return createPopper(wrapperRef.value!, popoverRef.value!.popupRef.value, {
|
||||
const createPopperInstance = () =>
|
||||
createPopper(wrapperRef.value!, popoverRef.value!.popupRef.value, {
|
||||
placement: props.placement,
|
||||
modifiers: [
|
||||
{
|
||||
@ -130,7 +130,6 @@ export default defineComponent({
|
||||
}),
|
||||
],
|
||||
});
|
||||
};
|
||||
|
||||
const updateLocation = () => {
|
||||
nextTick(() => {
|
||||
|
@ -101,7 +101,7 @@ test('clear multiple toast', async () => {
|
||||
Toast.allowMultiple(false);
|
||||
});
|
||||
|
||||
test('remove toast DOM when cleared in multiple mode', async function () {
|
||||
test('remove toast DOM when cleared in multiple mode', async () => {
|
||||
Toast.allowMultiple();
|
||||
Toast.clear(true);
|
||||
const toast = Toast({ className: 'remove-toast' });
|
||||
|
@ -65,11 +65,10 @@ export default defineComponent({
|
||||
],
|
||||
|
||||
setup(props, { emit, slots }) {
|
||||
const isActiveItem = (id: number | string) => {
|
||||
return Array.isArray(props.activeId)
|
||||
const isActiveItem = (id: number | string) =>
|
||||
Array.isArray(props.activeId)
|
||||
? props.activeId.includes(id)
|
||||
: props.activeId === id;
|
||||
};
|
||||
|
||||
const renderSubItem = (item: TreeSelectChild) => {
|
||||
const onClick = () => {
|
||||
|
@ -221,8 +221,8 @@ export default {
|
||||
};
|
||||
|
||||
// 返回 Promise
|
||||
const asyncBeforeRead = (file) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const asyncBeforeRead = (file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
if (file.type !== 'image/jpeg') {
|
||||
Toast('Please upload an image in jpg format');
|
||||
reject();
|
||||
@ -233,7 +233,6 @@ export default {
|
||||
resolve(img);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
beforeRead,
|
||||
|
@ -240,8 +240,8 @@ export default {
|
||||
};
|
||||
|
||||
// 返回 Promise
|
||||
const asyncBeforeRead = (file) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const asyncBeforeRead = (file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
if (file.type !== 'image/jpeg') {
|
||||
Toast('请上传 jpg 格式图片');
|
||||
reject();
|
||||
@ -252,7 +252,6 @@ export default {
|
||||
resolve(img);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
beforeRead,
|
||||
@ -449,8 +448,8 @@ import Compressor from 'compressorjs';
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const beforeRead = (file) => {
|
||||
return new Promise((resolve) => {
|
||||
const beforeRead = (file) =>
|
||||
new Promise((resolve) => {
|
||||
// compressorjs 默认开启 checkOrientation 选项
|
||||
// 会将图片修正为正确方向
|
||||
new Compressor(file, {
|
||||
@ -460,7 +459,6 @@ export default {
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
beforeRead,
|
||||
|
Loading…
x
Reference in New Issue
Block a user