1 | uniapp实战之项目介绍与搭建

项目介绍

  • 做的是黑马程序员的“懂你找图”微信小程序
  • 可以浏览和下载精美图片和视频
    在这里插入图片描述

项目搭建

(1)新建项目

脚手架方式

创建项目 vue create -p dcloudio/uni-preset-vue 项目名
安装 sass依赖 npm install sass-loader node-sass

HBuilderX方式
新建一个uniapp项目,默认模板就好了 (本次实战我使用这种方式)
在这里插入图片描述

(2)新增一个tabbar页面

在这里插入图片描述

pages.json

"tabBar": {
		"color": "#8a8a8a",
		"selectedColor": "#d4237a",
		"backgroundColor": "#fff",
		"position": "bottom",
		"borderStyle": "black",
		"list": [{
				"pagePath": "pages/home/index",
				"iconPath": "./static/icon/_home.png",
				"selectedIconPath": "./static/icon/home.png",
				"text": "首页"
			}, {
				"pagePath": "pages/horizontal/index",
				"iconPath": "./static/icon/_img.png",
				"selectedIconPath": "./static/icon/img.png",
				"text": "横屏"
			},
			{
				"pagePath": "pages/video/index",
				"text": "精美视频",
				"iconPath": "./static/icon/_videocamera.png",
				"selectedIconPath": "./static/icon/videocamera.png"
			},
			{
				"pagePath": "pages/search/index",
				"text": "搜索",
				"iconPath": "./static/icon/_search.png",
				"selectedIconPath": "./static/icon/search.png"
			},
			{
				"pagePath": "pages/mine/index",
				"text": "我的",
				"iconPath": "./static/icon/_my.png",
				"selectedIconPath": "./static/icon/my.png"
			}
		]
	}

在这里插入图片描述

(3)引入字体图标
  • 字体图标使用的是 iconfont
  • 在 App.vue中 全局引入
<style>
	/*每个页面公共css */
	@import "./styles/base.wxss";
	@import "./styles/iconfont.wxss";
</style>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值