deps: 组件类型
This commit is contained in:
parent
6d3f790a57
commit
6863859f8d
@ -1,13 +1,18 @@
|
|||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import { useWindowSize } from "@vueuse/core";
|
import { useWindowSize } from "@vueuse/core";
|
||||||
|
|
||||||
|
interface DeviceSize {
|
||||||
|
isPc: ComputedRef<boolean>;
|
||||||
|
isPad: ComputedRef<boolean>;
|
||||||
|
isMobile: ComputedRef<boolean>;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 小于 768px:适配移动设备(如手机)。
|
* 小于 768px:适配移动设备(如手机)。
|
||||||
* 768px - 1024px:适配平板设备。
|
* 768px - 1024px:适配平板设备。
|
||||||
* 大于 1024px:适配桌面设备。
|
* 大于 1024px:适配桌面设备。
|
||||||
* @returns PC窗口isPc, 平板窗口isPad, 移动端窗口isMobile
|
* @returns PC窗口isPc, 平板窗口isPad, 移动端窗口isMobile
|
||||||
*/
|
*/
|
||||||
export const useDevicesSize = () => {
|
export const useDevicesSize = (): DeviceSize => {
|
||||||
const { width } = useWindowSize();
|
const { width } = useWindowSize();
|
||||||
const isPc = computed(() => width.value > 1024);
|
const isPc = computed(() => width.value > 1024);
|
||||||
const isPad = computed(() => width.value > 768 && width.value <= 1024);
|
const isPad = computed(() => width.value > 768 && width.value <= 1024);
|
||||||
|
|||||||
@ -115,6 +115,7 @@ import { useThemeConfig } from "@/store/modules/theme-config";
|
|||||||
import { useThemeMethods } from "@/hooks/useThemeMethods";
|
import { useThemeMethods } from "@/hooks/useThemeMethods";
|
||||||
import { useDevicesSize } from "@/hooks/useDevicesSize";
|
import { useDevicesSize } from "@/hooks/useDevicesSize";
|
||||||
import { useRoutesConfigStore } from "@/store/modules/route-config";
|
import { useRoutesConfigStore } from "@/store/modules/route-config";
|
||||||
|
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { isMobile } = useDevicesSize();
|
const { isMobile } = useDevicesSize();
|
||||||
@ -181,7 +182,7 @@ const onUpdate = () => {
|
|||||||
|
|
||||||
// 项目地址
|
// 项目地址
|
||||||
const onProject = () => {
|
const onProject = () => {
|
||||||
window.open("https://gitee.com/wang_fan_w/SnowAdmin", "_blank");
|
window.open("https://github.com/WANG-Fan0912/SnowAdmin", "_blank");
|
||||||
};
|
};
|
||||||
|
|
||||||
// 退出登录
|
// 退出登录
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div class="snow-page">
|
<div class="snow-page">
|
||||||
<a-card title="简介">
|
<a-card title="简介">
|
||||||
<div>
|
<div>
|
||||||
<p>SnowAdmin 一款基于 Vue、TypeScript、Vite5、Pinia、arco-design开源的后台管理框架,使用目前最新技术栈开发。</p>
|
<p>SnowAdmin 一款基于 Vue、TypeScript、Vite5、Pinia、arco.design开源的后台管理框架,使用目前最新技术栈开发。</p>
|
||||||
<p>融合了全新的UI框架,高度可自定义的主题功能使得用户可以根据自身需求轻松定制界面。</p>
|
<p>融合了全新的UI框架,高度可自定义的主题功能使得用户可以根据自身需求轻松定制界面。</p>
|
||||||
<p>代码全注释,可提供参考和学习。</p>
|
<p>代码全注释,可提供参考和学习。</p>
|
||||||
</div>
|
</div>
|
||||||
@ -10,7 +10,7 @@
|
|||||||
<a-card class="margin-top" title="项目信息">
|
<a-card class="margin-top" title="项目信息">
|
||||||
<a-descriptions :column="2" bordered>
|
<a-descriptions :column="2" bordered>
|
||||||
<a-descriptions-item v-for="item of projectInfo" :key="item.label" :label="item.label">
|
<a-descriptions-item v-for="item of projectInfo" :key="item.label" :label="item.label">
|
||||||
<a-link :href="item.value" v-if="item.link">{{ item.label }}</a-link>
|
<a-link :href="item.value" v-if="item.link" target="_blank">{{ item.label }}</a-link>
|
||||||
<span v-else>{{ item.value }}</span>
|
<span v-else>{{ item.value }}</span>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
</a-descriptions>
|
</a-descriptions>
|
||||||
|
|||||||
@ -67,9 +67,9 @@ const list = reactive({
|
|||||||
callMe: [
|
callMe: [
|
||||||
{ label: "📧邮箱", value: "2547096351@qq.com", link: false },
|
{ label: "📧邮箱", value: "2547096351@qq.com", link: false },
|
||||||
{ label: "📠微信", value: "fanction-w", link: false },
|
{ label: "📠微信", value: "fanction-w", link: false },
|
||||||
|
{ label: "🛰️github", value: "兔子先森", link: true, url: "https://github.com/WANG-Fan0912" },
|
||||||
{ label: "📚思否", value: "兔子先森", link: true, url: "https://segmentfault.com/blog/dcodes" },
|
{ label: "📚思否", value: "兔子先森", link: true, url: "https://segmentfault.com/blog/dcodes" },
|
||||||
{ label: "✒️掘金", value: "兔子先森Ace", link: true, url: "https://juejin.cn/user/1728883023940600/posts" },
|
{ label: "✒️掘金", value: "兔子先森Ace", link: true, url: "https://juejin.cn/user/1728883023940600/posts" }
|
||||||
{ label: "🛰️gitee", value: "兔子先森Ace", link: true, url: "https://gitee.com/wang_fan_w" }
|
|
||||||
],
|
],
|
||||||
other: [
|
other: [
|
||||||
{ label: "🧭公众号", value: "DCodes" },
|
{ label: "🧭公众号", value: "DCodes" },
|
||||||
|
|||||||
4
src/vite-env.d.ts
vendored
4
src/vite-env.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
declare module "*.vue" {
|
declare module "*.vue" {
|
||||||
import { defineComponent } from "vue";
|
import { DefineComponent } from "vue";
|
||||||
const component: ReturnType<typeof defineComponent>;
|
const component: DefineComponent<{}, {}, any>;
|
||||||
export default component;
|
export default component;
|
||||||
}
|
}
|
||||||
declare module "vue-i18n";
|
declare module "vue-i18n";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user