Commit 3c441a05da0fcc2df7677f04cacd9bfc36f2a72d

Authored by Vben
1 parent 26adbc92

style(eslint): fix eslint error

src/components/Application/src/search/AppSearchKeyItem.vue
1 1 <template>
2 2 <span :class="$attrs.class">
3   - <g-icon :icon="icon" />
  3 + <Icon :icon="icon" />
4 4 </span>
5 5 </template>
6 6 <script lang="ts">
7 7 import { defineComponent } from 'vue';
  8 + import { Icon } from '/@/components/Icon';
8 9 export default defineComponent({
  10 + components: { Icon },
9 11 props: {
10 12 icon: String,
11 13 },
... ...
src/components/Application/src/search/AppSearchModal.vue
... ... @@ -4,7 +4,7 @@
4 4 <div :class="getClass" @click.stop v-if="visible">
5 5 <div :class="`${prefixCls}-content`" v-click-outside="handleClose">
6 6 <div :class="`${prefixCls}-input__wrapper`">
7   - <a-input
  7 + <Input
8 8 :class="`${prefixCls}-input`"
9 9 :placeholder="t('common.searchText')"
10 10 allow-clear
... ... @@ -14,7 +14,7 @@
14 14 <!-- <Icon icon="ion:search"/> -->
15 15 <SearchOutlined />
16 16 </template>
17   - </a-input>
  17 + </Input>
18 18 <span :class="`${prefixCls}-cancel`" @click="handleClose">
19 19 {{ t('common.cancelText') }}
20 20 </span>
... ... @@ -76,7 +76,7 @@
76 76  
77 77 export default defineComponent({
78 78 name: 'AppSearchModal',
79   - components: { Icon, SearchOutlined, AppSearchFooter, [Input.name]: Input },
  79 + components: { Icon, SearchOutlined, AppSearchFooter, Input },
80 80 directives: {
81 81 clickOutside,
82 82 },
... ...
src/components/CountDown/src/CountButton.vue
... ... @@ -21,7 +21,7 @@
21 21 name: 'CountButton',
22 22 components: { Button },
23 23 props: {
24   - value: propTypes.string,
  24 + value: propTypes.any,
25 25 count: propTypes.number.def(60),
26 26 beforeStartFunc: {
27 27 type: Function as PropType<() => boolean>,
... ...
src/components/Cropper/src/index.vue
... ... @@ -57,18 +57,19 @@
57 57 default: '360px',
58 58 },
59 59 crossorigin: {
60   - type: String,
  60 + type: String as PropType<'' | 'anonymous' | 'use-credentials' | undefined>,
61 61 default: undefined,
62 62 },
63 63 imageStyle: {
64 64 type: Object as PropType<CSSProperties>,
65   - default: {},
  65 + default: () => {},
66 66 },
67 67 options: {
68 68 type: Object as PropType<Options>,
69   - default: {},
  69 + default: () => {},
70 70 },
71 71 },
  72 + emits: ['cropperedInfo'],
72 73 setup(props, ctx) {
73 74 const imgElRef = ref<ElRef<HTMLImageElement>>(null);
74 75 const cropper: any = ref<Nullable<Cropper>>(null);
... ... @@ -109,17 +110,17 @@
109 110 // event: return base64 and width and height information after cropping
110 111 const croppered = (): void => {
111 112 let imgInfo = cropper.value.getData();
112   - cropper.value.getCroppedCanvas().toBlob(blob => {
113   - let fileReader: FileReader = new FileReader()
  113 + cropper.value.getCroppedCanvas().toBlob((blob) => {
  114 + let fileReader: FileReader = new FileReader();
114 115 fileReader.onloadend = (e: any) => {
115   - ctx.emit("cropperedInfo", {
  116 + ctx.emit('cropperedInfo', {
116 117 imgBase64: e.target.result,
117   - imgInfo
118   - })
119   - }
120   - fileReader.readAsDataURL(blob)
121   - }, 'image/jpeg')
122   - }
  118 + imgInfo,
  119 + });
  120 + };
  121 + fileReader.readAsDataURL(blob);
  122 + }, 'image/jpeg');
  123 + };
123 124  
124 125 onMounted(init);
125 126  
... ...
src/components/Form/src/components/FormAction.vue
... ... @@ -67,15 +67,15 @@
67 67 showAdvancedButton: propTypes.bool.def(true),
68 68 resetButtonOptions: {
69 69 type: Object as PropType<ButtonOptions>,
70   - default: {},
  70 + default: () => {},
71 71 },
72 72 submitButtonOptions: {
73 73 type: Object as PropType<ButtonOptions>,
74   - default: {},
  74 + default: () => {},
75 75 },
76 76 actionColOptions: {
77 77 type: Object as PropType<Partial<ColEx>>,
78   - default: {},
  78 + default: () => {},
79 79 },
80 80 actionSpan: propTypes.number.def(6),
81 81 isAdvanced: propTypes.bool,
... ...
src/components/Form/src/components/FormItem.vue
... ... @@ -28,15 +28,15 @@
28 28 },
29 29 formProps: {
30 30 type: Object as PropType<FormProps>,
31   - default: {},
  31 + default: () => {},
32 32 },
33 33 allDefaultValues: {
34 34 type: Object as PropType<Recordable>,
35   - default: {},
  35 + default: () => {},
36 36 },
37 37 formModel: {
38 38 type: Object as PropType<Recordable>,
39   - default: {},
  39 + default: () => {},
40 40 },
41 41 setFormModel: {
42 42 type: Function as PropType<(key: string, value: any) => void>,
... ...
src/components/SimpleMenu/src/SimpleMenuTag.vue
... ... @@ -14,7 +14,7 @@
14 14 props: {
15 15 item: {
16 16 type: Object as PropType<Menu>,
17   - default: {},
  17 + default: () => {},
18 18 },
19 19 dot: propTypes.bool,
20 20 collapseParent: propTypes.bool,
... ...
src/components/SimpleMenu/src/SimpleSubMenu.vue
... ... @@ -64,7 +64,7 @@
64 64 props: {
65 65 item: {
66 66 type: Object as PropType<Menu>,
67   - default: {},
  67 + default: () => {},
68 68 },
69 69 parent: propTypes.bool,
70 70 collapsedShowTitle: propTypes.bool,
... ...
src/components/SimpleMenu/src/components/Menu.vue
... ... @@ -30,7 +30,7 @@
30 30 activeName: propTypes.oneOfType([propTypes.string, propTypes.number]),
31 31 openNames: {
32 32 type: Array as PropType<string[]>,
33   - default: [],
  33 + default: () => [],
34 34 },
35 35 accordion: propTypes.bool.def(true),
36 36 width: propTypes.string.def('100%'),
... ... @@ -39,7 +39,7 @@
39 39 collapse: propTypes.bool.def(true),
40 40 activeSubMenuNames: {
41 41 type: Array as PropType<(string | number)[]>,
42   - default: [],
  42 + default: () => [],
43 43 },
44 44 },
45 45 emits: ['select', 'open-change'],
... ...
src/components/Table/src/components/HeaderCell.vue
... ... @@ -23,7 +23,7 @@
23 23 props: {
24 24 column: {
25 25 type: Object as PropType<BasicColumn>,
26   - default: {},
  26 + default: () => {},
27 27 },
28 28 },
29 29 setup(props) {
... ...
src/components/Table/src/components/editable/EditableCell.vue
... ... @@ -60,7 +60,7 @@
60 60 },
61 61 column: {
62 62 type: Object as PropType<BasicColumn>,
63   - default: {},
  63 + default: () => {},
64 64 },
65 65 index: propTypes.number,
66 66 },
... ...
src/components/Table/src/components/settings/index.vue
... ... @@ -30,7 +30,7 @@
30 30 props: {
31 31 setting: {
32 32 type: Object as PropType<TableSetting>,
33   - default: {},
  33 + default: () => {},
34 34 },
35 35 },
36 36 setup(props) {
... ...
src/layouts/default/setting/components/SelectItem.vue
... ... @@ -41,7 +41,7 @@
41 41 },
42 42 options: {
43 43 type: Array as PropType<LabelValueOptions>,
44   - default: [],
  44 + default: () => [],
45 45 },
46 46 },
47 47 setup(props) {
... ...
src/locales/useLocale.ts
... ... @@ -34,8 +34,8 @@ export function useLocale() {
34 34 const getLocale = computed(() => localeStore.getLocale);
35 35 const getShowLocalePicker = computed(() => localeStore.getShowPicker);
36 36  
37   - const getAntdLocale = computed(() => {
38   - return i18n.global.getLocaleMessage(unref(getLocale))?.antdLocale;
  37 + const getAntdLocale = computed((): any => {
  38 + return i18n.global.getLocaleMessage(unref(getLocale))?.antdLocale ?? {};
39 39 });
40 40  
41 41 // Switching the language will change the locale of useI18n
... ...
src/views/demo/comp/cropper/index.vue
1 1 <template>
2 2 <PageWrapper title="图片裁剪示例" contentBackground>
3 3 <div class="cropper-container">
4   - <CropperImage ref="refCropper" src="https://fengyuanchen.github.io/cropperjs/images/picture.jpg" @cropperedInfo="cropperedInfo" style="width:40%" />
  4 + <CropperImage
  5 + ref="refCropper"
  6 + src="https://fengyuanchen.github.io/cropperjs/images/picture.jpg"
  7 + @cropperedInfo="cropperedInfo"
  8 + style="width: 40%"
  9 + />
5 10 <a-button type="primary" @click="onCropper"> 裁剪 </a-button>
6 11 <img :src="cropperImg" class="croppered" v-if="cropperImg" />
7 12 </div>
... ... @@ -20,41 +25,42 @@
20 25 },
21 26 setup() {
22 27 let vm: any;
23   - let info = ref("");
24   - let cropperImg = ref("");
  28 + let info = ref('');
  29 + let cropperImg = ref('');
25 30  
26 31 const onCropper = (): void => {
27 32 vm.refs.refCropper.croppered();
28   - }
  33 + };
29 34  
30   - onBeforeMount(()=>{
  35 + onBeforeMount(() => {
31 36 vm = getCurrentInstance();
32   - })
  37 + });
33 38  
34   - function cropperedInfo({ imgBase64, imgInfo }) {
35   - info.value = imgInfo
36   - cropperImg.value = imgBase64
37   - }
  39 + function cropperedInfo({ imgBase64, imgInfo }) {
  40 + info.value = imgInfo;
  41 + cropperImg.value = imgBase64;
  42 + }
38 43  
39 44 return {
40 45 img,
41 46 info,
42 47 cropperImg,
43 48 onCropper,
44   - cropperedInfo
  49 + cropperedInfo,
45 50 };
46 51 },
47 52 });
48 53 </script>
49 54  
50 55 <style scoped>
51   -.cropper-container {
52   - display:flex;
53   - justify-content: space-around;
54   - align-items: center;
55   -}
56   -.croppered {
57   - width: 50%;
58   - height: 100%;
59   -}
  56 + .cropper-container {
  57 + display: flex;
  58 + justify-content: space-around;
  59 + align-items: center;
  60 + }
  61 +
  62 + .croppered {
  63 + width: 50%;
  64 + height: 100%;
  65 + }
60 66 </style>
... ...