3 Star 16 Fork 4

BluesYoung-web / vue3-vant-app

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Vue3 + Vant + Typescript + Vite2

  • 基于 vue3 + vant + typescript + vite2 的移动端app模板
  • 方法自动按需导入(基于unplugin-auto-import)
  • 组件自动按需导入(基于unplugin-vue-components)
  • 使用 windicss,零配置自动 css 摇树优化
  • 使用原子化的 unocss,根据类名自动生成对应的样式
  • 拥有自动创建页面的 node 脚本,实现页面创建及路由注册自动化

环境

推荐 node 16+(lts)

权限管理

  • 用户必须登录之后才能进行操作
  • 否则只能访问路由白名单中的路径

前置条件

  • 在项目根目录下新建 .env.local 文件,内容如下:
# !!! 变量名必须以 VITE_ 开头
# 使用 import.meta.变量名 获取

# 接口请求地址,后端使用 nginx 代理来跨域时,使用绝对路径
VITE_BASE_HTTP = '/api'
# 启用 VConsole 控制台(按需启用,生产环境无需配置)
VITE_ENABLE_VCONSOLE = true

使用

# 装依赖
yarn
# 本地运行
yarn dev
# 打包
yarn build # 限制运行内存
yarn build:prod # 不限制运行内存
yarn pre # 预览打包后的文件

自动创建页面

  • 快捷指令 yarn create-new-page
  • 命令行:
    • 装完依赖之后,需要执行 npm link ./bin
    • 执行完成之后可以直接在命令行输入 create-new-page 即可(拥有命令自动补全)
MIT License Copyright (c) 2021 张扬 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

使用 vue3 + vant + vite2 + typescript 搭建的移动端通用模板 展开 收起
TypeScript 等 4 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/BluesYoung-web/vue3-vant-app.git
git@gitee.com:BluesYoung-web/vue3-vant-app.git
BluesYoung-web
vue3-vant-app
vue3-vant-app
master

搜索帮助