作用提供HTML5,微信小程序功能,提供打包
下载雷电模拟器
iconfont.cn的图标官网
1.新建一个项目


2.pages.json
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "主页"
}
}, {
"path": "pages/ucenter/ucenter",
"style": {
"navigationBarTitleText": "我的"
}
},
{
"path": "pages/ucenter/discover",
"style": {
"navigationBarTitleText": "发现"
}
}
],
"tabBar": {
"color": "#000000",
"selectedColor": "#2F85FC",
"backgroundColor": "#FFFFFF",
"borderStyle": "black",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/home.png",
"selectedIconPath": "static/home-active.png",
"text": "主页"
},
{
"pagePath": "pages/ucenter/ucenter",
"iconPath": "static/center.png",
"selectedIconPath": "static/center-active.png",
"text": "我的"
},
{
"pagePath": "pages/ucenter/discover",
"iconPath": "static/discover.png",
"selectedIconPath": "static/discover.png",
"text": "发现"
}
]
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}
ucenter
<template>
<view class="content">
<view>
<text class="title">{{name}}</text>
<navigator url="setting" hover-class="navigator-hover">
<button type="primary">个人设置</button>
</navigator>
</view>
</view>
</template>
<script>
export default {
data() {
return {
name: '我的'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
text-align: center;
height: 400upx;
}
.title {
font-size: 36upx;
color: #8f8f94;
}
</style>
index
<template>
<view class="content">
<view>
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
text-align: center;
height: 400upx;
}
.title {
font-size: 36upx;
color: #8f8f94;
}
</style>
手机运行结果:



网友评论