Files
BMS/bms-front/src/layout/components/Sidebar/Link.vue
T
wuweihua 6081a98bcc feat: BMS 项目初始化(前端+后端)
- 前端 bms-front:基于 RuoYi-Vue3,封装 BasicForm/BasicTable 公共组件,替换 18 个业务页面表格
- 后端 bms-back:基于 RuoYi-Vue,包含 system/quartz/generator 等模块
- 项目标题由若依管理系统改为 BMS
2026-08-28 11:45:11 +08:00

41 lines
592 B
Vue

<template>
<component :is="type" v-bind="linkProps()">
<slot />
</component>
</template>
<script setup>
import { isExternal } from '@/utils/validate'
const props = defineProps({
to: {
type: [String, Object],
required: true
}
})
const isExt = computed(() => {
return isExternal(props.to)
})
const type = computed(() => {
if (isExt.value) {
return 'a'
}
return 'router-link'
})
function linkProps() {
if (isExt.value) {
return {
href: props.to,
target: '_blank',
rel: 'noopener'
}
}
return {
to: props.to
}
}
</script>