init:first commit of plus-ui

This commit is contained in:
Teo
2025-05-21 11:24:53 +08:00
commit 95e38df6a5
2219 changed files with 2478311 additions and 0 deletions

View File

@ -0,0 +1,40 @@
<template>
<component :is="type" v-bind="linkProps()">
<slot />
</component>
</template>
<script setup lang="ts">
import { isExternal } from '@/utils/validate';
const props = defineProps({
to: {
type: [String, Object],
required: true
}
});
const isExt = computed(() => {
return isExternal(props.to as string);
});
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>