4 Star 57 Fork 25

燕博文 / taro-vue3-pinia

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

简介

taro-vue3-pinia 是一个使用 Taro3 + Vue3 + TypeScript + NutUi + pinia + unocss + pnpm 跨端模板,它使用了最新的前端技术栈,内置丰富的插件,有着极高的代码规范,开箱即用的跨端前端解决方案,也可用于学习参考。

特性

  • 最新技术栈:使用 Taro3 + Vue3 + TypeScript + NutUi + pinia + unocss + pnpm 等前端前沿技术开发
  • TypeScript: 应用程序级 JavaScript 的语言
  • 代码规范:丰富的规范插件及极高的代码规范

代码仓库

Vscode 插件安装

  • 根据项目.vscode 提示安装所需插件
  • 建议开启 Volar Takeover 模式
  • 请使用 pnpm commit 代替 git commit

当前实现了的功能

  • Taro3 Vue3 Ts pinia
  • unocss 集成
  • 组件库 NutUI
  • 小程序分包配置
  • Taro3 配合 Vue DevTools 调试
  • 样式封装 1px 问题 底部安全区域适配
  • 暗黑模式 & 主题定制

小程序分包配置

随着业务代码和组件的引入越来越多,主包的大小一定会越来越大,超过 2m 的主包以后微信开发工具就无法使用预览的功能,为了提前做好准备在一开始就进行分包处理,主包只包含组件和公共代码,分包里放入业务代码

// app.config.ts
export default {
	pages: ["pages/index/index"],
	window: {
		backgroundColor: "#fff",
		backgroundTextStyle: "light",
		navigationBarBackgroundColor: "#fff",
		navigationBarTitleText: "Taro3",
		navigationBarTextStyle: "black",
	},
	subpackages: [
		{
			root: "pages/packageA",
			pages: ["index/index"],
		},
	],
};

主题定制

  • 使用 unocss 完善主题定制,需在每个页面引入作为根组件, 实现方案ConfigProvider

小程序配置细节

需要注意开发者工具的项目设置:

  • 需要设置关闭 ES6 转 ES5 功能,开启可能报错
  • 需要设置关闭上传代码时样式自动补全,开启可能报错
  • 需要设置关闭代码压缩上传,开启可能报错

其他限制

  • 小程序中不支持 <style scoped>,建议使用 cssModules 代替。
  • 自定义 navbar 在模拟器上 safe-area-inset-top 失效,真机可以微信社区
  • 自定义 tabbar 使用 svg 或者 icon,图片会出现抖动问题微信社区
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.

简介

基于Taro3+Vue3+Nutui的跨端方案模板 展开 收起
TypeScript 等 5 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/zhongjiancrm/taro-vue3-pinia.git
git@gitee.com:zhongjiancrm/taro-vue3-pinia.git
zhongjiancrm
taro-vue3-pinia
taro-vue3-pinia
main

搜索帮助