美丽寮步网站建设,做招聘的网站有哪些内容,建德营销型网站建设,静态网页素材WebView app.是全局配置#xff0c;app.json是全局配置文件#xff0c;在页面的.json配置文件中的配置会覆盖我们全局的配置 快捷键#xff1a; .box 敲回车 ----- view classbox/view .row*8 敲回车#xff1a; .row{$}*8 敲回车 案例1… WebView app.是全局配置app.json是全局配置文件在页面的.json配置文件中的配置会覆盖我们全局的配置 快捷键 .box 敲回车 ----- view classbox/view .row*8 敲回车 .row{$}*8 敲回车 案例1 .wxss:
.box{color: red;border:3px solid rgb(196, 240, 196);
}
.wxml: view class box跟我一起学小程序/view 案例2
px和rpx的差异
px单位是固定大小不会随着屏幕的改变而改变rpx是响应式布局 案例3 .wxml: hover-stop-propagation子元素阻止父元素冒泡
view classbox hover-classboxhover hover-start-time0 hover-stay-time200王婆卖瓜 view class inner hover-classinnerhover hover-stop-propagation true老王卖鱼/view
/view
view11111/view
view22222/view
text user-select33333/text
text44444/text
text user-select 55555/text
view-----------/view
text spaceensp 6 6 6 6 6/text
view-----------/view
text spaceemsp 6 6 6 6 6/text
view-----------/view
text spacenbsp 6 6 6 6 6/text
view-----------/view
text decode lt; 77777/textview-----------/view
text lt; 77777/text
viewicon type warn size100 colorpink/iconicon type waiting size50/icon
/view
viewprogress percent 30 show-info border-radius100 stroke-width10/progress
/view .wxss:
.box{width:200px;height:200px;background: red;
}.boxhover{background: palegreen;
}.box .inner{width:80px;height:80px;background: palevioletred;}
.inner.innerhover{background: seashell;
}案例4scroll-view
没有之前 竖向滚动 .wxml:
scroll-view class myScroll scroll-yview classrow1/viewview classrow2/viewview classrow3/viewview classrow4/viewview classrow5/viewview classrow6/viewview classrow7/viewview classrow8/view
/scroll-view !-- scroll-view可滚动scroll-y竖向滚动 -- .wxss:
.myScroll{width: 100%; /*沾满整个屏幕 */height:500rpx;background: #eeeeee;
}.myScroll .row{width: 220rpx;height:220rpx; background: palegreen;margin-bottom: 10rpx; /* 每个容器底部间距10rpx */
} 横向滚动 强制一行然后实现滚动效果 /*1、把子容器排成一行 如果只有inline的话width、height就不起作用了 */ display: inline-block; /*2、强制让子元素挤在一行*/ white-space: nowrap; wxml:
scroll-view class myScroll scroll-xview classrow1/viewview classrow2/viewview classrow3/viewview classrow4/viewview classrow5/viewview classrow6/viewview classrow7/viewview classrow8/view
/scroll-view !-- scroll-view可滚动scroll-y竖向滚动 -- wxss
.myScroll{width: 100%; /*沾满整个屏幕 */height:500rpx;background: #eeeeee;/*2、强制让子元素挤在一行*/white-space: nowrap;
}.myScroll .row{width: 220rpx;height:220rpx; background: palegreen;/*1、把子容器排成一行 如果只有inline的话width、height就不起作用了 */display: inline-block; margin-right: 10rpx; } /* 每个元素都有10间隔 最后一个元素不需要有间隔:*/
.myScroll .row:last-child{margin-right: 0;
}
案例5movable-area自由移动 拖动图形验证功能可以使用这个实现
movable-area、 movable-view必须联合使用 movable-view才是可移动区域 movable-area 必须设置width和height属性不设置默认为10px**当movable-view小于movable-area时movable-view的移动范围是在movable-area内当movable-view大于movable-area时movable-view的移动范围必须包含movable-area movable-view 属性类型默认值必填说明directionstringnone否 movable-view的移动方向 属性值有all、vertical、horizontal、none inertiabooleanfalse否movable-view是否带有惯性out-of-boundsbooleanfalse否超过可移动区域后movable-view是否还可以移动 .wxml:
movable-area stylewidth: 400rpx;height:400rpx;background:#ccc; overflow: hidden;!-- out-of-bounds可以移出、overflow: hidden移出后隐藏移出部分 -- movable-view directionall inertia x20rpx y20rpx out-of-boundsstylewidth: 150rpx;height: 150rpx;background: green;viewhello/view/movable-view
/movable-area 案例6navigator页面链接导航 navigator url /pages/index/index hover-classhoverNav这是跳转到index页面/navigatornavigator url /pages/index/index classout hover-classhoverNavimage src/static/pic2.png modeaspectFit classimage/image
/navigator .out .image{width: 200rpx;height: 200rpx;
}.hoverNav{color: aquamarine;background:rgb(248, 52, 101);
}
相对路径 退出两层 ../../
/代表根目录
案例7app.js
app.js是全局配置文件 用的比较多的是globalData全局变量 看控制台 如何修改全局变量的值呢 案例8data差值表达式中: 两个花括号 view我的名字是{{myName}}
/view
设置一个定时器在页面加载完成2s后修改值 这个号是连接符 true和false必须放在差值表达式中 if else两个盒子要放在一起如果你中间加了一些别的字符就会报错