TypeScript 支持

This commit is contained in:
RuoYi
2026-01-28 12:21:57 +08:00
parent 5cb67df134
commit a4ae9c79fa
183 changed files with 6452 additions and 5024 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
</component>
</template>
<script setup>
<script setup lang="ts">
import { isExternal } from '@/utils/validate'
const props = defineProps({
+1 -1
View File
@@ -13,7 +13,7 @@
</div>
</template>
<script setup>
<script setup lang="ts">
import logo from '@/assets/logo/logo.png'
import useSettingsStore from '@/store/modules/settings'
import variables from '@/assets/styles/variables.module.scss'
@@ -27,9 +27,9 @@
</div>
</template>
<script setup>
<script setup lang="ts">
import { isExternal } from '@/utils/validate'
import AppLink from './Link'
import AppLink from './Link.vue'
import { getNormalPath } from '@/utils/ruoyi'
const props = defineProps({
@@ -50,7 +50,7 @@ const props = defineProps({
const onlyOneChild = ref({})
function hasOneShowingChild(children = [], parent) {
function hasOneShowingChild(children: any[] = [], parent: any) {
if (!children) {
children = []
}
@@ -76,7 +76,7 @@ function hasOneShowingChild(children = [], parent) {
return false
}
function resolvePath(routePath, routeQuery) {
function resolvePath(routePath: string, routeQuery?: string): string | { path: string; query: Record<string, any> } {
if (isExternal(routePath)) {
return routePath
}
@@ -84,13 +84,13 @@ function resolvePath(routePath, routeQuery) {
return props.basePath
}
if (routeQuery) {
let query = JSON.parse(routeQuery)
const query = JSON.parse(routeQuery)
return { path: getNormalPath(props.basePath + '/' + routePath), query: query }
}
return getNormalPath(props.basePath + '/' + routePath)
}
function hasTitle(title){
function hasTitle(title: string): string {
if (title.length > 5) {
return title
} else {
+3 -3
View File
@@ -24,9 +24,9 @@
</div>
</template>
<script setup>
import Logo from './Logo'
import SidebarItem from './SidebarItem'
<script setup lang="ts">
import Logo from './Logo.vue'
import SidebarItem from './SidebarItem.vue'
import variables from '@/assets/styles/variables.module.scss'
import useAppStore from '@/store/modules/app'
import useSettingsStore from '@/store/modules/settings'