2025最新版研发vite7.1+vue3.5+pinia3+arco.design
仿mac/wins网页版os后台系统。
vite7-webos使用最新前端构建工具vite7
搭建项目模板,vue3 setup
语法编码开发。
import { createApp } from 'vue'
import './style.scss'
import App from './App.vue'
// 引入arco.design组件库
import ArcoDesign from '@arco-design/web-vue'
import '@arco-design/web-vue/dist/arco.css'
// 额外引入图标库
import ArcoIcon from '@arco-design/web-vue/es/icon'
import VEPlus from 've-plus'
import 've-plus/dist/ve-plus.css'
// 引入路由及状态管理
import Router from './router'
import Pinia from './pinia'
createApp(App)
.use(ArcoDesign)
.use(ArcoIcon)
.use(VEPlus)
.use(Router)
.use(Pinia)
.mount('#app')
内置了macos和windows两种风格模板。
<script setup>
import { appState } from '@/pinia/modules/app'
// 引入布局模板
import MacosLayout from './template/macos.vue'
import WindowsLayout from './template/windows.vue'
const appstate = appState()
const DeskLayout = {
macos: MacosLayout,
windows: WindowsLayout
}
</script>
<template>
<div
class="vu__container desktop flexbox flex-alignc flex-justifyc"
:style="{'--themeSkin': appstate.config.skin}"
@contextmenu.prevent
>
<component :is="DeskLayout[appstate.config.layout]" />
</div>
</template>
<template>
<div class="vu__layout flexbox flex-col">
<div class="vu__layout-header">
<Toolbar />
</div>
<div class="vu__layout-body flex1 flexbox">
<Desk />
</div>
<div class="vu__layout-footer">
<Dock />
</div>
<!-- 悬浮球(辅助触控) -->
<Touch />
</div>
</template>
// 自定义桌面图标变量
const deskVariable = ref({
'--icon-radius': '10px', // 圆角
'--icon-size': '60px', // 图标尺寸(设置rpx自定义手机设备)
'--icon-gap-col': '30px', // 水平间距
'--icon-gap-row': '30px', // 垂直间距
'--icon-labelSize': '12px', // 标签文字大小
'--icon-labelColor': '#fff', // 标签颜色
'--icon-fit': 'contain', // 图标自适应模式
})
支持如下参数
/**
* ====== desk菜单配置项 ======
* label 图标标题
* imgico 图标(本地或网络图片) 支持Arco Design内置图标或自定义iconfont图标
* path 跳转路由页面
* link 跳转外部链接
* hideLabel 是否隐藏图标标题
* filter 是否禁用拖拽
* background 自定义图标背景色
* color 自定义图标颜色
* size 栅格磁贴布局(16种) 1x1 ... 12x12
* padding 内边距
* onClick 点击图标回调函数
* children 二级菜单
*/
桌面json配置片段
const deskMenu = [
{
uid: '9a16fb90-12c4-11e1-840d-1a25c5bb775a',
list: [
...
{label: '日历', imgico: markRaw(Calendar4x2), size: '4x2'},
{label: '每日箴言', imgico: markRaw(DayTalk), size: '3x2'},
{label: '倒计时', imgico: markRaw(CountDown), size: '3x2'},
{label: 'DeepSeek', imgico: 'https://cdn.deepseek.com/logo.png', link: 'https://chat.deepseek.com/', size: '2x1'},
{label: 'Vite^7.1.2', imgico: 'https://vite.dev/logo.svg', link: 'https://vite.dev/'},
]
},
{
uid: '9a16fb90-12c4-11e1-840d-1c25d5cc775a',
list: [
{label: 'Appstore', imgico: '/static/mac/appstore.png'},
{label: '地图', imgico: '/static/mac/maps.png'},
{label: '浏览器', imgico: '/static/mac/safari.png'},
...
]
},
{
uid: '9a16fb90-12c4-11e1-840d-7d25e5ff775a',
list: [
{label: 'Vite7.1.2', imgico: 'vite.svg', link: 'https://vite.dev/', background: '#EAFAFF', padding: '20px', size: '2x2'},
{label: 'Github', imgico: '/static/svg/github.svg', link: 'https://github.com/', background: '#607d8b', size: '2x1'},
{label: '码云Gitee', imgico: '/static/svg/gitee.svg', link: 'https://gitee.com/', background: '#bb2124', size: '1x2'},
...
]
},
{
uid: 'u738f210-807e-1e4e-1550-4deefac27e48',
list: [
{label: 'DeepSeek', imgico: 'https://cdn.deepseek.com/logo.png', link: 'https://chat.deepseek.com/', size: '3x2'},
{label: '豆包', imgico: 'https://lf-flow-web-cdn.doubao.com/obj/flow-doubao/doubao/web/static/image/OnboardingAvatar.0f4f29a4.webp', size: '2x2'},
...
]
},
{
uid: 'd141f210-207e-1e8e-9950-9heefyu27e48',
list: [
{label: 'Vite^7.1.2', imgico: 'https://vite.dev/logo.svg', link: 'https://vite.dev/'},
{
label: '编程开发',
children: [
{label: 'DeepSeek', imgico: 'https://www.faxianai.com/wp-content/uploads/2025/02/20250205134524-1febd.png', link: 'https://chat.deepseek.com/',},
...
]
},
{label: '首页', imgico: markRaw(IconHome), path: '/home', color: '#fff'},
{
label: '组件',
children: [
{label: '表格', imgico: '/static/svg/table.svg', path: '/components/table/all'},
...
]
},
{
label: '个人中心',
children: [
{label: '主页', imgico: '/static/svg/my.svg', path: '/setting'},
{label: '用户管理', imgico: markRaw(IconUser), path: '/user', color: '#fff'},
...
]
},
{
label: '设置',
children: [
{label: '网站设置', imgico: '/static/svg/settings.svg', path: '/setting/system/website'},
{label: '邮件服务', imgico: '/static/mac/mail.png', path: '/setting/system/mail'},
]
},
{
label: '公众号', imgico: markRaw(IconWechat), color: '#07c160',
onClick: () => {
...
}
},
]
}
]
Electron38+Vite7+Pinia3+ElementPlus客户端聊天程序
最新原创uniapp-vue3-osadmin手机版后台管理系统
最新原创flutter3.27+bitsdojo_window客户端聊天Exe
基于uni-app+vue3实战短视频+聊天+直播app商城
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。