当前位置:网站首页>Creating a uniapp project using hbuilder x

Creating a uniapp project using hbuilder x

2022-06-25 16:39:00 Like angels

Use hbuilder X establish uniapp project

One 、 open hbuilder X Software , top left corner file - newly build - project , Pictured :

 Insert picture description here
Two 、 In the pop-up window , Fill in the project name , Choose your own project case , You can choose according to your own needs vue edition 2/3, Pictured :

 Insert picture description here
3、 ... and 、 By this time your project has been created , Automatically by the hbuilderX open , The general contents of the project documents are shown in the figure :

 Insert picture description here
Four 、 Set the bottom navigation jump , open pages.json file (pages Is the route jump address ,tabBar Is to configure the bottom navigation bar ), If the top navigation wants to add the corresponding button icon , Additable ‘app-plus’ To configure , there ‘fontSrc’ The icon comes from Ali , Here are the steps to download the Alibaba icon , First look at pages.json File configuration of

{
    
	"pages": [{
    
		"path": "pages/index/index",
		"style": {
    
			"navigationBarTitleText": " Everyone knows "
		}
	}, {
    
		"path": "pages/message/index",
		"style": {
    
			"navigationBarTitleText": " news ",
			"app-plus": {
    
				"titleNView": {
    
					"buttons": [{
    
						"text": "",
						"fontSrc": "/static/iconfont/iconfont.ttf",
						"fontSize": "20",
						"float": "right",
						"color": "#7A7E83"
					}]
				}
			}
		}
	}, {
    
		"path": "pages/personel/index",
		"style": {
    
			"navigationBarTitleText": " my "
		}
	}, {
    
		"path": "pages/collectInfo/index",
		"style": {
    
			"navigationBarTitleText": " information acquisition "
		}
	}, {
    
		"path": "pages/messageDetails/index",
		"style": {
    
			"navigationBarTitleText": " News details "
		}

	}],
	"tabBar": {
    
		"color": "#7A7E83",
		"selectedColor": "#1296db",
		"borderStyle": "black",
		"backgroundColor": "#ffffff",
		"height": "50px",
		"fontSize": "10px",
		"iconWidth": "24px",
		"spacing": "3px",
		"iconfontSrc": "static/iconfont.ttf", // app tabbar  typeface .ttf File path  app 3.4.4+
		"list": [{
    
			"pagePath": "pages/index/index",
			"iconPath": "static/home.png",
			"selectedIconPath": "static/se_home.png",
			"text": " home page "
		}, {
    
			"pagePath": "pages/message/index",
			"iconPath": "static/message.png",
			"selectedIconPath": "static/se_message.png",
			"text": " news "
		}, {
    
			"pagePath": "pages/personel/index",
			"iconPath": "static/mine.png",
			"selectedIconPath": "static/se_mine.png",
			"text": " my "
		}]
	},
	"globalStyle": {
    
		"navigationBarTextStyle": "black",
		"navigationBarTitleText": "uni-app",
		"navigationBarBackgroundColor": "#fff",
		"backgroundColor": "#fff",
		"app-plus": {
    
			"background": "#efeff4"
		}
	}
}

Ali icon download , Search for the icon you need , Add cart - Add to project - Download to local , This will download a compressed package , After decompressing iconfont.ttf Copy files to your own project , stay pages.json Just introduce the corresponding icon in the :

 Insert picture description here

 Insert picture description here
 Insert picture description here

Final rendering of the page :

 Insert picture description here

Change begins with persistence and commitment.

原网站

版权声明
本文为[Like angels]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251546587817.html