1.在head-vue中的homehead的样式加入以下代码,使得上面的背景颜色变成渐变色 创建一个从左上角开始的径向渐变。 //第二行同此 渐变的中心位于元素左上角的50%高度和200px宽度的位置。 渐变的起始颜色是#D5F8FC,然后渐变到透明。background: radial-gradient(50% 200px at left top,#D5f8fc,transparent), radial-gradient(50% 200px at right top,#D3CBFC,transparent);2.去官网下载导入uni-dateformat 日期格式化的组件到项目中,并重新启动hbuilder,并修改以前代码的年月日的空白如下,format代表具体格式取值当前时间,可以看官方插件文档<view class="time"> <view class="left"> <uni-dateformat :date="
1.先新建一个components的组件的文件夹里面创建一个home-head.vue的组件,再在index.vue中引用这个组件2.home-head.vue的代码如下<template> <view class="homehead"> <view class="statusBar" :style="{height:getStatusBarHeight()+'px'}"> </view>//引用从system.js中获取的变量值 <view class="titleBar" :style="{height:getTitleBarHeight()+'px'}">今日份鸡汤来咯</view> <view class="content"> <view class="time"> <view
1.在page.info中加入"navigationStyle": "custom",可以使页面变成无头部导航栏的通屏2.对index.vue进行了修改<template> <view class="homeLayout"> <view class="head">头部</view> <view class="body"> <view class="swiperOut">//滑动组件 <swiper vertical>//vertical是设置属性为向下滑动 <swiper-item v-for="(item,index) in 5"> //循环index数组在item的项目中,item是固有属性,每一项对应一个index {{index+1}} </swiper-i
1.建立tarbar"tabBar": { "color": "#333", "selectedColor": "#74dbef", "list": [ { "text": "首页", "pagePath": "pages/index/index", "iconPath": "static/images/home.png", "selectedIconPath": "static/images/home-h.png" }, { "text": "我的", &q
1.微信开发者工具中,存在中文路径,容易报错,最好使用英文路径 2.view标签里面不能用\n换行符,但text的标签可以 3.vh是百分比单位,如15vh,就可以是占15% 4.justify-content: space-between;/* 均匀排列每个元素首个元素放置于起点,末尾元素放置于终点 */ 5.padding: 0 30rpx //第一个参数是上下边距,第二个参数是左右边距 6.当样式中,子级样式中里面有共同的样式,可以放在父级样式中,进行编辑 7. 用computed来进行复杂运算并获取计算值如const lineWidthcomputed(()=>currentIndex.value/(listData.value.length-1)*100) 8.scss加入局部属性scoped,css样式就只作用于本页面 9。align-items: center; //垂直中心 justify-content: center; //水平中心 10.css的1双选择器,该1标签class
ikrins