当前位置:网站首页>使用hbuilder X创建uniapp项目
使用hbuilder X创建uniapp项目
2022-06-25 15:48:00 【天使的同类】
使用hbuilder X创建uniapp项目
一、打开hbuilder X软件,左上角 文件-新建-项目,如图:

二、在弹窗内,填写项目名称,选择你自己需要的项目案例,可根据自己需求选择vue版本2/3,如图:

三、这时你的项目已经创建好了,自动由hbuilderX打开,项目大致文件内容如图:

四、设置底部导航跳转,打开pages.json文件(pages是路由跳转地址,tabBar是配置底部导航栏),如果顶部导航想要添加相应的按钮图标,可添加‘app-plus’配置,这里的‘fontSrc’图标来自阿里,下面有如何下载阿里图标的步骤,先看pages.json的文件配置吧
{
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "人人通"
}
}, {
"path": "pages/message/index",
"style": {
"navigationBarTitleText": "消息",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "",
"fontSrc": "/static/iconfont/iconfont.ttf",
"fontSize": "20",
"float": "right",
"color": "#7A7E83"
}]
}
}
}
}, {
"path": "pages/personel/index",
"style": {
"navigationBarTitleText": "我的"
}
}, {
"path": "pages/collectInfo/index",
"style": {
"navigationBarTitleText": "信息采集"
}
}, {
"path": "pages/messageDetails/index",
"style": {
"navigationBarTitleText": "消息详情"
}
}],
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#1296db",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"height": "50px",
"fontSize": "10px",
"iconWidth": "24px",
"spacing": "3px",
"iconfontSrc": "static/iconfont.ttf", // app tabbar 字体.ttf文件路径 app 3.4.4+
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/home.png",
"selectedIconPath": "static/se_home.png",
"text": "首页"
}, {
"pagePath": "pages/message/index",
"iconPath": "static/message.png",
"selectedIconPath": "static/se_message.png",
"text": "消息"
}, {
"pagePath": "pages/personel/index",
"iconPath": "static/mine.png",
"selectedIconPath": "static/se_mine.png",
"text": "我的"
}]
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#fff",
"backgroundColor": "#fff",
"app-plus": {
"background": "#efeff4"
}
}
}
阿里图标下载,搜索你需要的图标,添加购物车-添加至项目-下载至本地,这是就会下载一个压缩包,解压之后把iconfont.ttf文件拷贝到自己的项目中,在pages.json中引入相应的图标就可以了:



页面最终效果图:

Change begins with persistence and commitment.
边栏推荐
- [untitled]
- Servlet详解
- Don't underestimate the integral mall, its role can be great!
- 2021, committed to better development
- DOM event flow, event delegate
- [Third Party framework] retrofit2 (2) - add point configuration of network access framework
- Stop "outsourcing" Ai models! The latest research finds that some "back doors" that undermine the security of machine learning models cannot be detected
- Nsurlsession learning notes (III) download task
- 一行代码可以做什么?
- Reading mysql45 lecture - index continued
猜你喜欢

Stop "outsourcing" Ai models! The latest research finds that some "back doors" that undermine the security of machine learning models cannot be detected

Xinlou: un voyage de sept ans de Huawei Sports Health

从TiDB上线阿里云的背后,如何看待云数据库的变革趋势

Educational administration system development (php+mysql)

GridLayout evenly allocate space

cmd。。。。。。

10 Super VIM plug-ins, I can't put them down

In the wechat environment, H5 jumps to the specified page of the applet

error Parsing error: Unexpected reserved word ‘await‘.

What can one line of code do?
随机推荐
What plug-ins are available for vscade?
Unity技术手册 - 生命周期内大小(Size over Lifetime)和速度决定大小(Size by Speed)
Most commonly used SQL statements
Day_ fourteen
Tensorflow loading cifar10 dataset
数据存储和传输文件之XML使用和解析详解
Stop "outsourcing" Ai models! The latest research finds that some "back doors" that undermine the security of machine learning models cannot be detected
DOM event flow, event delegate
iVX低代码平台系列详解 -- 概述篇(一)
AD域登录验证
Mt60b1g16hc-48b:a micron memory particles FBGA code d8bnk[easy to understand]
数字经济时代文化消费新特征
Dart syntax
心楼:华为运动健康的七年筑造之旅
Don't underestimate the integral mall, its role can be great!
普通人的2022春招总结(阿里、腾讯offer)
【效率】又一款笔记神器开源了!
Understanding of reflection part
Day_ twelve
Blue Bridge Cup - practice system login