首先用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
我的網站小程序