首先用HBuilderX新建建一个uni-app项目html
新建一个目录ucenter,该目录下新建两个vue文件ucenter.vue和setting.vuevue
<template> <view class="container"> <text>{{ name }}的我的中心</text> <navigator url="../ucenter/setting" hover-class="navigator-hover"> <button type="default">设置</button> </navigator> </view> </template> <script> export default { data() { return { name: '陶然然' }; }, onLoad() {}, methods: {} }; </script> <style> .container { width: 95%; margin: 0 auto; text-align: center; } </style>
<template> <view class="container"> 举世无双 </view> </template> <script> </script> <style> </style>
{ "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { "path": "pages/index/index", "style": { "navigationBarTitleText": "uni-app" } } ,{ "path" : "pages/ucenter/ucenter", "style" : { "navigationBarTitleText": "中心" } }, { "path" : "pages/ucenter/setting", "style" : { "navigationBarTitleText": "我的设置" } } ], "tabBar": { "color": "#000000", "selectedColor": "#2F85FC", "backgroundColor": "#FFFFFF", "borderStyle": "black", "list": [ { "pagePath": "pages/index/index", "iconPath": "static/book.png", "selectedIconPath": "static/book_no.png", "text": "主页" }, { "pagePath": "pages/ucenter/ucenter", "iconPath": "static/write.png", "selectedIconPath": "static/write_a.png", "text": "个人" } ] }, "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" } }
首先要登陆,没有账号能够注册,接着点击运行—原生App-云打包,配置完后点击打包,首次打包,提示说appid不能为空,跳转出基础配置页面,点击云端获取,接下来再次打包就能够顺利完成了git
安装到手机的效果以下
github
我的网站小程序