Skip to content

Commit 1fa443d

Browse files
committed
sub some demo
1 parent c9be001 commit 1fa443d

File tree

12 files changed

+141
-176
lines changed

12 files changed

+141
-176
lines changed

README-zh_CN.md

+9-98
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55

66

7-
> 这是一个基础的 vue3 admin 管理后台。它只包含了 Element-Plus UI & axios & svg-icon& permission control & lint,这些搭建后台必要的东西。
7+
> vue3 mobile vant 提供企业级的移动端开发架构
88
99

10-
本架构使用的技术为:vue3(setup-script)+vite2+element-plus 的新一代的前端框架,It's fast!
10+
本架构使用的技术为:vue3(setup-script)+vite2+vant3 的新一代的前端框架,It's fast!
1111

1212
使用 eslint+prettier+gitHooks 格式和校验代码,提高代码规范性和开发效率
1313

14-
Vite 需要 Node.js 版本 >= 12.0.0。
14+
> rem适配规则,vant根据 375,而开发时使用的是750,详情请查看"postcss.config.js"配置文件
1515
1616
## 更新日志
1717

@@ -39,39 +39,20 @@ github 地址: https://github.com/jzfai/vue3-mobile-vant.git
3939

4040
---- 我们先看看加载速度和构建后的包大小:
4141

42-
![template-speed-analysis](http://8.135.1.141/file/images/template-speed-analysis.png)
42+
![template-speed-analysis](http://8.135.1.141/file/images/vant-speed-analysis.png)
4343

44-
![template-demo](http://8.135.1.141/file/images/template-demo.png)
44+
![template-demo](http://8.135.1.141/file/images/mobile-demo.png)
4545

4646
## 相关项目
4747

48-
框架有js,ts,plus和electron版本
49-
50-
- js版本:[vue3-element-admin](https://github.com/jzfai/vue3-mobile-vant.git)
51-
- ts版本:[vue3-element-ts](https://github.com/jzfai/vue3-admin-ts.git)
52-
- js实例参考plus版本:[vue3-element-plus](https://github.com/jzfai/vue3-admin-plus.git)
53-
- electron版本:[vue3-element-electron](https://github.com/jzfai/vue3-admin-electron.git)
54-
- react版本: [react-admin-template](https://github.com/jzfai/react-admin-template.git)
48+
框架有js,ts版本
49+
- js version:[vue3-mobile-vant](https://github.com/jzfai/vue3-mobile-vant.git)
50+
- ts version:[vue3-mobile-vant-ts](https://github.com/jzfai/vue3-admin-vant-ts.git)
51+
- js version for plus:[vue3-element-plus](https://github.com/jzfai/vue3-admin-plus.git)
5552
- java微服务后台数据:[micro-service-plus](https://github.com/jzfai/micro-service-plus)
5653

5754
> 开发和使用感受:两个字 真香!!!!!
5855
59-
60-
61-
vue3和vue2在性能上的对比
62-
63-
- 打包大小减少41%
64-
65-
- 初次渲染快55%, 更新渲染快133%
66-
67-
- 内存减少54%
68-
69-
- **使用Proxy代替defineProperty实现数据响应式**
70-
71-
- **重写虚拟DOM的实现和Tree-Shaking**
72-
73-
[vite2和webpack打包速度上的对比](https://github.com/jzfai/vue3-mobile-vant/issues/2)
74-
7556
## 构建步骤
7657

7758
```bash
@@ -116,76 +97,6 @@ pnpm run preview
11697
pnpm run lint
11798
```
11899

119-
## 功能
120-
121-
```
122-
- 登录 / 注销
123-
124-
- 权限验证
125-
- 页面权限
126-
- 指令权限
127-
- 权限配置
128-
- 二步登录
129-
130-
- 多环境发布
131-
- serve
132-
- build
133-
- priview
134-
- lint
135-
136-
- 全局功能
137-
#- 国际化多语言
138-
#- 多种动态换肤
139-
- 动态侧边栏(支持多级路由嵌套)
140-
- 动态面包屑
141-
- 快捷导航(标签页)
142-
- Svg Sprite 图标
143-
- 本地/后端 mock 数据
144-
#- Screenfull全屏
145-
- 自适应收缩侧边栏
146-
147-
- 编辑器
148-
- 富文本
149-
- Markdown
150-
#- JSON 等多格式
151-
152-
#- Excel
153-
#- 导出excel
154-
#- 导入excel
155-
#- 前端可视化excel
156-
#- 导出zip
157-
158-
- 表格
159-
- 动态表格
160-
#- 拖拽表格
161-
#- 内联编辑
162-
163-
- 错误页面
164-
- 401
165-
- 404
166-
167-
- 組件
168-
- 头像上传
169-
- 返回顶部
170-
#- 拖拽Dialog
171-
#- 拖拽Select
172-
#- 拖拽看板
173-
#- 列表拖拽
174-
#- SplitPane
175-
#- Dropzone
176-
#- Sticky
177-
#- CountTo
178-
179-
- 综合实例
180-
- 错误日志
181-
- Dashboard
182-
#- 引导页
183-
- ECharts 图表
184-
#- Clipboard(剪贴复制)
185-
#- Markdown2html
186-
```
187-
188-
>注:#---暂未实现(希望大家能一起开发)
189100

190101
## 额外
191102

README.md

+8-26
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
**English** | [中文](./README-zh_CN.md)
44

5-
> vue3 admin plus provides enterprise-level development demo
5+
> vue3 mobile vant provides enterprise-level mobile development demo
66
7-
A new generation admin construct using vue3(setup-script)+vite2+vant3.x ,It's fast!
7+
A new generation mobile construct using vue3(setup-script)+vite2+vant3 ,It's easy and fast!
88

99
Use eslint+prettier+gitHooks format and verification code to improve code standardization and development efficiency
1010

11-
11+
>the rem flexible, vant ui according to 375, but developing is 750 , detail to look the "postcss.config.js"
1212
1313
## Update log
1414

@@ -34,38 +34,20 @@ github 地址: https://github.com/jzfai/vue3-mobile-vant.git
3434

3535
---- Let's look at the loading speed and the size of the built package first.:
3636

37-
![template-speed-analysis](http://8.135.1.141/file/images/template-speed-analysis.png)
37+
![template-speed-analysis](http://8.135.1.141/file/images/mobile-speed-analysis.png)
3838

39-
![template-demo](http://8.135.1.141/file/images/plus-demo.png)
39+
![template-demo](http://8.135.1.141/file/images/mobile-demo.png)
4040

4141
## Related items
4242

43-
The framework is available in js, ts , plus and electron versions
44-
- js version:[vue3-element-admin](https://github.com/jzfai/vue3-mobile-vant.git)
45-
- ts version:[vue3-element-ts](https://github.com/jzfai/vue3-admin-ts.git)
43+
The framework is available in js, ts versions
44+
- js version:[vue3-mobile-vant](https://github.com/jzfai/vue3-mobile-vant.git)
45+
- ts version:[vue3-mobile-vant-ts](https://github.com/jzfai/vue3-admin-vant-ts.git)
4646
- js version for plus:[vue3-element-plus](https://github.com/jzfai/vue3-admin-plus.git)
47-
- js version for electron:[vue3-element-electron](https://github.com/jzfai/vue3-admin-electron.git)
48-
- react version: [react-admin-template](https://github.com/jzfai/react-admin-template.git)
4947
- java Micro-service background data:[micro-service-plus](https://github.com/jzfai/micro-service-plus)
5048
> development and experience:two words Really fragrant!!!!!
5149
5250

53-
54-
#### Comparison of performance between vue3 and vue2
55-
56-
- 41% reduction in package size
57-
58-
- The initial rendering is 55% faster, the update rendering is 133% faster
59-
60-
- Memory reduction 54%
61-
62-
- **Use Proxy instead of defineProperty to implement data responsiveness**
63-
64-
- **Rewrite the implementation of virtual DOM and Tree-Shaking**
65-
66-
67-
[Comparison of packaging speed between vite2 and webpack](https://github.com/jzfai/vue3-mobile-vant/issues/2)
68-
6951
## Build Setup
7052

7153
```bash

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"vant": "3.3.7",
2020
"vue-router": "4.0.12",
2121
"vuex": "4.0.2",
22-
"nprogress": "0.2.0",
2322
"vue": "3.2.26"
2423
},
2524
"devDependencies": {

src/permission.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
import router from './router'
2-
import NProgress from 'nprogress'
32
import settings from './settings'
43
router.beforeEach(async (to, from, next) => {
5-
if (settings.isNeedNprogress) NProgress.start()
6-
74
//jump page
85
next()
96
})
107

11-
router.afterEach(() => {
12-
if (settings.isNeedNprogress) NProgress.done()
13-
})
8+
router.afterEach(() => {})

src/router/modules/example.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
/** When your routing table is too long, you can split it into small modules**/
22
const exampleRouter = [
3+
{
4+
path: '/example',
5+
component: () => import('@/views/example'),
6+
name: 'Example',
7+
meta: { title: 'Example' }
8+
},
39
{
410
path: '/hook',
511
component: () => import('@/views/example/hook/Hook.vue'),

src/settings.js

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
const setting = {
2-
/**
3-
* @type {boolean} true | false
4-
* @description Whether need nprogress
5-
*/
6-
isNeedNprogress: true,
72
/**
83
* @type {boolean} true | false
94
* @description Whether open prod mock

src/views/dashboard/index.vue

+55-38
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,74 @@
11
<template>
2-
<div class="mbPx-4">req relative</div>
3-
<van-button type="primary" size="small" @click="testReq">test Req</van-button>
2+
<div class="mbPx-4 mt-4">基础用法</div>
3+
<van-count-down :time="time" />
44

5-
<div class="mbPx-4 mt-4">mock demo</div>
6-
<van-button type="primary" size="small" @click="mockRelative">mockRelative</van-button>
5+
<div class="mbPx-4 mt-4">自定义格式</div>
6+
<van-count-down :time="time" format="DD 天 HH 时 mm 分 ss 秒" />
77

8-
<div class="mbPx-4 mt-4">VuexUse</div>
9-
<van-button type="primary" size="small" @click="VuexUse">VuexUse</van-button>
8+
<div class="mbPx-4 mt-4">毫秒级渲染</div>
9+
<van-count-down millisecond :time="time" format="HH:mm:ss:SS" />
1010

11-
<div class="mbPx-4 mt-4">SvgIcon</div>
12-
<van-button type="primary" size="small" @click="SvgIcon">SvgIcon</van-button>
11+
<div class="mbPx-4 mt-4">自定义样式</div>
12+
<van-count-down :time="time">
13+
<template #default="timeData">
14+
<span class="block">{{ timeData.hours }}</span>
15+
<span class="colon">:</span>
16+
<span class="block">{{ timeData.minutes }}</span>
17+
<span class="colon">:</span>
18+
<span class="block">{{ timeData.seconds }}</span>
19+
</template>
20+
</van-count-down>
1321

14-
<div class="mbPx-4 mt-4">KeepAlive</div>
15-
<van-button type="primary" size="small" @click="KeepAlive">KeepAlive</van-button>
22+
<div class="mbPx-4 mt-4">手动控制</div>
23+
<van-count-down ref="countDown" millisecond :time="3000" :auto-start="false" format="ss:SSS" @finish="onFinish" />
24+
<van-grid clickable>
25+
<van-grid-item text="开始" icon="play-circle-o" @click="start" />
26+
<van-grid-item text="暂停" icon="pause-circle-o" @click="pause" />
27+
<van-grid-item text="重置" icon="replay" @click="reset" />
28+
</van-grid>
29+
30+
<div class="mb-2 mt-5">to look the use demo</div>
31+
<van-button type="primary" size="small" @click="ToExample">ToExample</van-button>
1632
</template>
1733

1834
<script setup>
1935
import { onMounted, watch, ref, toRefs, reactive, computed } from 'vue'
20-
import axiosReq from '@/utils/axiosReq'
21-
import useVant from '@/hooks/useVant'
22-
import useRouter from '@/hooks/useRouter'
36+
const time = ref(30 * 60 * 60 * 1000)
2337
24-
const testReq = () => {
25-
let reqConfig = {
26-
url: '/ty-user/user/loginOut',
27-
method: 'post',
28-
bfLoading: false,
29-
isAlertErrorMsg: false
30-
}
31-
axiosReq(reqConfig).then((res) => {
32-
useVant.vantToastNoneMixin('req success')
33-
})
34-
}
38+
const countDown = ref(null)
3539
36-
//mock
37-
const mockRelative = () => {
38-
useRouter.routerPushMixin('MockTest')
40+
const start = () => {
41+
countDown.value.start()
3942
}
40-
41-
//VuexUse
42-
const VuexUse = () => {
43-
useRouter.routerPushMixin('VuexUse')
43+
const pause = () => {
44+
countDown.value.pause()
4445
}
45-
46-
//SvgIcon
47-
const SvgIcon = () => {
48-
useRouter.routerPushMixin('SvgIcon')
46+
const reset = () => {
47+
countDown.value.reset()
4948
}
49+
import { Toast } from 'vant'
50+
const onFinish = () => Toast('倒计时结束')
51+
import useRouter from '@/hooks/useRouter'
5052
51-
//KeepAlive
52-
const KeepAlive = () => {
53-
useRouter.routerPushMixin('KeepAlive')
53+
//ToExample
54+
const ToExample = () => {
55+
useRouter.routerPushMixin('Example')
5456
}
5557
</script>
5658

5759
<style scoped lang="scss"></style>
60+
<style>
61+
.colon {
62+
display: inline-block;
63+
margin: 0 8px;
64+
color: #ee0a24;
65+
}
66+
.block {
67+
display: inline-block;
68+
width: 44px;
69+
color: #fff;
70+
font-size: 28px;
71+
text-align: center;
72+
background-color: #ee0a24;
73+
}
74+
</style>

0 commit comments

Comments
 (0)