Skip to content

Commit 922f83d

Browse files
committed
refactor: vue3.3 defineOptions
1 parent a5c7c88 commit 922f83d

File tree

259 files changed

+955
-381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+955
-381
lines changed

src/App.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
<script lang="ts" name="APP" setup>
1+
<script lang="ts" setup>
22
import { isDark } from '@/utils/is'
33
import { useAppStore } from '@/store/modules/app'
44
import { useDesign } from '@/hooks/web/useDesign'
55
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
66
import routerSearch from '@/components/RouterSearch/index.vue'
77
8+
defineOptions({ name: 'APP' })
9+
810
const { getPrefixCls } = useDesign()
911
const prefixCls = getPrefixCls('app')
1012
const appStore = useAppStore()

src/components/Backtop/src/Backtop.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<script lang="ts" name="BackTop" setup>
1+
<script lang="ts" setup>
22
import { ElBacktop } from 'element-plus'
33
import { useDesign } from '@/hooks/web/useDesign'
44
5+
defineOptions({ name: 'BackTop' })
6+
57
const { getPrefixCls, variables } = useDesign()
68
79
const prefixCls = getPrefixCls('backtop')

src/components/ConfigGlobal/src/ConfigGlobal.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script lang="ts" name="ConfigGlobal" setup>
1+
<script lang="ts" setup>
22
import { propTypes } from '@/utils/propTypes'
33
import { useLocaleStore } from '@/store/modules/locale'
44
import { useAppStore } from '@/store/modules/app'
@@ -7,6 +7,8 @@ import { useDesign } from '@/hooks/web/useDesign'
77
import { ElementPlusSize } from '@/types/elementPlus'
88
import { useWindowSize } from '@vueuse/core'
99
10+
defineOptions({ name: 'ConfigGlobal' })
11+
1012
const { variables } = useDesign()
1113
1214
const appStore = useAppStore()

src/components/ContentDetailWrap/src/ContentDetailWrap.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<script lang="ts" name="ContentDetailWrap" setup>
1+
<script lang="ts" setup>
22
import { propTypes } from '@/utils/propTypes'
33
import { useDesign } from '@/hooks/web/useDesign'
44
5+
defineOptions({ name: 'ContentDetailWrap' })
6+
57
const { t } = useI18n()
68
79
const { getPrefixCls } = useDesign()

src/components/ContentWrap/src/ContentWrap.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<script lang="ts" name="ContentWrap" setup>
1+
<script lang="ts" setup>
22
import { propTypes } from '@/utils/propTypes'
33
import { useDesign } from '@/hooks/web/useDesign'
44
5+
defineOptions({ name: 'ContentWrap' })
6+
57
const { getPrefixCls } = useDesign()
68
79
const prefixCls = getPrefixCls('content-wrap')

src/components/CountTo/src/CountTo.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
<script lang="ts" name="CountTo" setup>
1+
<script lang="ts" setup>
22
import { PropType } from 'vue'
33
import { isNumber } from '@/utils/is'
44
import { propTypes } from '@/utils/propTypes'
55
import { useDesign } from '@/hooks/web/useDesign'
66
7+
defineOptions({ name: 'CountTo' })
8+
79
const { getPrefixCls } = useDesign()
810
911
const prefixCls = getPrefixCls('count-to')

src/components/Crontab/src/Crontab.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<script lang="ts" name="Crontab" setup>
1+
<script lang="ts" setup>
22
import { ElMessage } from 'element-plus'
33
import { PropType } from 'vue'
44
5+
defineOptions({ name: 'Crontab' })
6+
57
interface shortcutsType {
68
text: string
79
value: string
@@ -966,37 +968,37 @@ const submit = () => {
966968
<style scoped>
967969
.sc-cron:deep(.el-tabs__item) {
968970
height: auto;
969-
line-height: 1;
970971
padding: 0 7px;
972+
line-height: 1;
971973
vertical-align: bottom;
972974
}
973975
974976
.sc-cron-num {
975-
text-align: center;
976-
margin-bottom: 15px;
977977
width: 100%;
978+
margin-bottom: 15px;
979+
text-align: center;
978980
}
979981
980982
.sc-cron-num h2 {
981-
font-size: 12px;
982983
margin-bottom: 15px;
984+
font-size: 12px;
983985
font-weight: normal;
984986
}
985987
986988
.sc-cron-num h4 {
987989
display: block;
988-
height: 32px;
989-
line-height: 30px;
990990
width: 100%;
991-
font-size: 12px;
991+
height: 32px;
992992
padding: 0 15px;
993+
font-size: 12px;
994+
line-height: 30px;
993995
background: var(--el-color-primary-light-9);
994996
border-radius: 4px;
995997
}
996998
997999
.sc-cron:deep(.el-tabs__item.is-active) .sc-cron-num h4 {
998-
background: var(--el-color-primary);
9991000
color: #fff;
1001+
background: var(--el-color-primary);
10001002
}
10011003
10021004
[data-theme='dark'] .sc-cron-num h4 {

src/components/Cropper/src/CopperModal.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,16 @@
113113
</Dialog>
114114
</div>
115115
</template>
116-
<script lang="ts" name="CopperModal" setup>
116+
<script lang="ts" setup>
117117
import { useDesign } from '@/hooks/web/useDesign'
118118
import { dataURLtoBlob } from '@/utils/filt'
119119
import { useI18n } from 'vue-i18n'
120120
import type { CropendResult, Cropper } from './types'
121121
import { propTypes } from '@/utils/propTypes'
122122
import { CropperImage } from '@/components/Cropper'
123123
124+
defineOptions({ name: 'CopperModal' })
125+
124126
const props = defineProps({
125127
srcValue: propTypes.string.def(''),
126128
circled: propTypes.bool.def(true)

src/components/Cropper/src/Cropper.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
/>
1111
</div>
1212
</template>
13-
<script lang="ts" name="Cropper" setup>
13+
<script lang="ts" setup>
1414
import { CSSProperties, PropType } from 'vue'
1515
import Cropper from 'cropperjs'
1616
import 'cropperjs/dist/cropper.css'
1717
import { useDesign } from '@/hooks/web/useDesign'
1818
import { propTypes } from '@/utils/propTypes'
1919
import { useDebounceFn } from '@vueuse/core'
2020
21+
defineOptions({ name: 'Cropper' })
22+
2123
type Options = Cropper.Options
2224
2325
const defaultOptions: Options = {

src/components/Cropper/src/CropperAvatar.vue

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
/>
1212
</div>
1313
</template>
14-
<script lang="ts" name="CropperAvatar" setup>
14+
<script lang="ts" setup>
1515
import { useDesign } from '@/hooks/web/useDesign'
1616
1717
import { propTypes } from '@/utils/propTypes'
1818
import { useI18n } from 'vue-i18n'
1919
import CopperModal from './CopperModal.vue'
2020
21+
defineOptions({ name: 'CropperAvatar' })
22+
2123
const props = defineProps({
2224
width: propTypes.string.def('200px'),
2325
value: propTypes.string.def(''),
@@ -83,14 +85,14 @@ $prefix-cls: #{$namespace}--cropper-avatar;
8385
}
8486
8587
&-image-mask {
86-
opacity: 0%;
8788
position: absolute;
8889
width: inherit;
8990
height: inherit;
90-
border-radius: inherit;
91-
border: inherit;
92-
background: rgb(0 0 0 / 40%);
9391
cursor: pointer;
92+
background: rgb(0 0 0 / 40%);
93+
border: inherit;
94+
border-radius: inherit;
95+
opacity: 0;
9496
transition: opacity 0.4s;
9597
9698
::v-deep(svg) {
@@ -99,7 +101,7 @@ $prefix-cls: #{$namespace}--cropper-avatar;
99101
}
100102
101103
&-image-mask:hover {
102-
opacity: 4000%;
104+
opacity: 40;
103105
}
104106
105107
&-upload-btn {
@@ -121,21 +123,18 @@ $prefix-cls: #{$namespace}--cropper-avatar;
121123
height: 120px;
122124
}
123125
124-
.user-info-head:hover:after {
125-
content: '+';
126+
.user-info-head:hover::after {
126127
position: absolute;
127-
left: 0;
128-
right: 0;
129-
top: 0;
130-
bottom: 0;
131-
color: #eee;
132-
background: rgba(0, 0, 0, 0.5);
128+
inset: 0;
133129
font-size: 24px;
134-
font-style: normal;
135130
-webkit-font-smoothing: antialiased;
136131
-moz-osx-font-smoothing: grayscale;
137-
cursor: pointer;
132+
font-style: normal;
138133
line-height: 110px;
134+
color: #eee;
135+
cursor: pointer;
136+
background: rgb(0 0 0 / 50%);
139137
border-radius: 50%;
138+
content: '+';
140139
}
141140
</style>

0 commit comments

Comments
 (0)