# uni-preset-vue-vite **Repository Path**: wang-shaodi-02/uni-app-vue3-vite ## Basic Information - **Project Name**: uni-preset-vue-vite - **Description**: 使用vue3+vite搭建的uni-app项目支持多端运行 配置了开发版+正式版+测试版 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-08-07 - **Last Updated**: 2023-08-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: vue3vite搭建的uni-app ## README # uni-app+vue3+vite #### 介绍 使用vue3+vite搭建的uni-app项目支持多端运行 配置了开发版+正式版+测试版 #### 软件架构 软件架构说明 #### 安装教程 1. 下载下来之后 ``` npm i ``` 2. 测试 以开发版模式运行 ![Alt text](image.png) **这时候就可以运行你的代码了** 3.[具体教程地址](https://blog.csdn.net/weixin_43743175/article/details/129714696) ## 微信小程序分享业务 ### 每个页面都实现分享功能 **uni.onAppRoute方法是注册路由变化监听器** **这里在全局文件下注册** ``` export default { onLaunch(options) { // 监听小程序启动事件 uni.onAppRoute((res) => { console.log('路由变化:', res); // 在这里执行你的逻辑操作 uni.showShareMenu({ withShareTicket: true, // 文档地址:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html // 数组0为分享给朋友、数组1为分享到朋友圈 menus: ['shareAppMessage', 'shareTimeline'] }) // 文档地址:https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onShareTimeline 不配置的话有默认值 // onShareAppMessage() { // return { // title: '这是分享标题', // path: res.path, // imageUrl: 'http://example.com/share.jpg', // desc: '这是分享备注信息' // } // } }); }, onShow(options) { // 监听小程序显示事件 uni.onAppRoute((res) => { console.log('路由变化:', res); // 在这里执行你的逻辑操作 }); } } ```