U type define

This commit is contained in:
zhenorzz 2022-04-01 10:12:44 +08:00
parent 4677019f2d
commit c70f9cb096
5 changed files with 13 additions and 7 deletions

View File

@ -13,7 +13,8 @@
],
"rules": {
"vue/script-setup-uses-vars": "error",
"vue/multi-word-component-names": 0
"vue/multi-word-component-names": 0,
"@typescript-eslint/no-explicit-any": ["off"]
},
"env": {
"vue/setup-compiler-macros": true

View File

@ -347,6 +347,7 @@ import {
import { ProjectData } from '@/api/project'
import { NamespaceUserOption } from '@/api/namespace'
import { empty, parseTime } from '@/utils'
import type { ElRadioGroup } from 'element-plus'
import {
ElMessageBox,
ElMessage,
@ -557,8 +558,10 @@ const getPublishTrace = (publishToken: string) => {
})
}
const handleTraceChange = (lastPublishToken: string) => {
publishToken.value = lastPublishToken
const handleTraceChange: InstanceType<typeof ElRadioGroup>['onChange'] = (
lastPublishToken
) => {
publishToken.value = <string>lastPublishToken
getPublishTrace(publishToken.value)
}

View File

@ -702,7 +702,7 @@ import {
ProjectData,
} from '@/api/project'
import { getRole } from '@/utils/namespace'
import type { ElForm } from 'element-plus'
import type { ElRadioGroup, ElForm } from 'element-plus'
import { ElMessageBox, ElMessage } from 'element-plus'
import { ref } from 'vue'
import { useI18n } from 'vue-i18n'
@ -953,7 +953,9 @@ function getSymlinkPath(projectPath: string) {
)
}
function handleSymlink(value: boolean) {
const handleSymlink: InstanceType<typeof ElRadioGroup>['onChange'] = (
value
) => {
if (value) {
formData.value.symlinkPath = getSymlinkPath(formData.value.path)
} else {

View File

@ -87,7 +87,7 @@
:value="scope.row.state === 1"
active-color="#13ce66"
inactive-color="#ff4949"
@change="(value) => onSwitchState(value, scope.$index)"
@change="(value) => onSwitchState(value as boolean, scope.$index)"
>
</el-switch>
</template>

View File

@ -129,7 +129,7 @@ import { xterm } from './xterm'
import { ref, nextTick, ComponentPublicInstance } from 'vue'
interface terminal {
uuid: number
xterm?: xterm | void
xterm?: xterm
server: ServerData
}
const serverOptionVisible = ref(false)