Skip to content

Commit

Permalink
🍉feat:增加功能模块
Browse files Browse the repository at this point in the history
  • Loading branch information
durunsong committed Sep 27, 2024
1 parent 8369244 commit 9a59294
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ VITE_MODE = 'development'
## 变量必须以 VITE_ 为前缀才能暴露给外部读取

# 本地运行后端
# VITE_BASE_API = 'http://localhost:4000'
VITE_BASE_API = 'http://localhost:4000'

# 部署到 vercel
VITE_BASE_API = 'https://kilyicms-server.vercel.app'
# VITE_BASE_API = 'https://kilyicms-server.vercel.app'
2 changes: 2 additions & 0 deletions src/i18n/package/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const en = {
router_Page_level_authority: "Page level authority",
router_Button_level_authority: "Button level authority",
router_Site_Configuration: "Site Configuration",
router_Functions_and_Components: "Functions and Components",

// 其他字段
select_language: "Select Language",
Expand Down Expand Up @@ -224,6 +225,7 @@ const en = {
Top_mode: "Top mode",
mixed_mode: "Mixed mode",
Cancel_duplicate_request: "Cancel duplicate request",
function_card: "Function Card",
};

export default en;
2 changes: 2 additions & 0 deletions src/i18n/package/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const zh = {
router_Page_level_authority: "页面级权限",
router_Button_level_authority: "按钮级权限",
router_Site_Configuration: "前台网站配置",
router_Functions_and_Components: "功能与组件",
// 公共提示字段
select_language: "选择语言",
confirm_ok_text: "确认",
Expand Down Expand Up @@ -219,6 +220,7 @@ const zh = {
Left_side_mode: "左侧模式",
Top_mode: "顶部模式",
mixed_mode: "混合模式",
function_card: "功能卡片",
};

export default zh;
23 changes: 22 additions & 1 deletion src/router/modules/constantRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ export const constant_Routes: RouteRecordRaw[] = [
},
],
},
{
path: "/function-card",
component: Layouts,
redirect: "/function-card/functions-and-Components",
name: "functionCard",
meta: {
title: "function_card",
elIcon: "Grid",
alwaysShow: true,
},
children: [
{
path: "functions-and-Components",
component: () => import("@/views/function-card/index.vue"),
name: "FunctionsAndComponents",
meta: {
title: "router_Functions_and_Components",
},
},
],
},
{
path: "/unocss",
component: Layouts,
Expand All @@ -49,7 +70,7 @@ export const constant_Routes: RouteRecordRaw[] = [
{
path: "/hook-demo",
component: Layouts,
redirect: "/hook-demo/use-fetch-select",
redirect: "/hook-demo/use-fullscreen-loading",
name: "HookDemo",
meta: {
title: "router_Hooks",
Expand Down
17 changes: 3 additions & 14 deletions src/views/dashboard/components/Admin.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
<template>
<div class="app-container center">
<PlaneSwitch
v-model:checked="switchState"
@update:checked="handleSwitchChange"
/>
<p>Switch is {{ switchState ? "ON" : "OFF" }}</p>
<el-empty :description="t('hello_admin_page', { admin: 'admin' })" />
<el-empty
:description="t('hello_admin_page', { admin: 'admin' })"
></el-empty>
</div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const switchState = ref(true);
// 处理子组件发出的开关状态变化事件
const handleSwitchChange = (newState: boolean) => {
switchState.value = newState;
console.log("Switch state changed to", newState);
};
</script>

<style lang="scss" scoped>
Expand Down
34 changes: 34 additions & 0 deletions src/views/function-card/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<div class="flex flex-col items-center">
<el-card class="w-[400px] mt-5" shadow="always">
<PlaneSwitch
v-model:checked="switchState"
@update:checked="handleSwitchChange"
></PlaneSwitch>
<p>Switch is {{ switchState ? "ON" : "OFF" }}</p>
</el-card>
<el-card class="w-[400px]" shadow="always">
<p>标签图标</p>
<div
class="i-whh-mymusic text-blue-400"
role="img"
aria-hidden="true"
></div>
</el-card>
</div>
</template>

<script setup lang="ts">
import { ref } from "vue";
const switchState = ref(true);
// 处理子组件发出的开关状态变化事件
const handleSwitchChange = (newState: boolean) => {
switchState.value = newState;
console.log("Switch state changed to", newState);
};
</script>

<style scoped>
/* No additional styles needed as we're using UnoCSS utilities */
</style>
5 changes: 0 additions & 5 deletions src/views/unocss/index.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<template>
<div h-full uno-padding-20>
<div h-full text-center flex select-none all:transition-400>
<span
class="i-whh-mymusic text-blue-400"
role="img"
aria-hidden="true"
></span>
<div ma>
<div
text-5xl
Expand Down

0 comments on commit 9a59294

Please sign in to comment.