成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)-創(chuàng)新互聯(lián)

開始了解下小程序的組件。源碼:https://github.com/limingios/wxProgram.git 中的No.10

成都創(chuàng)新互聯(lián)專注于新津縣企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè)公司,商城網(wǎng)站制作。新津縣網(wǎng)站建設(shè)公司,為新津縣等地區(qū)提供建站服務(wù)。全流程按需搭建網(wǎng)站,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,成都創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)

組件

  • 多個(gè)組件構(gòu)成一張視圖頁面
    >經(jīng)過樣式和布局,頁面其實(shí)理解成html

  • 組件包含<開始標(biāo)簽></結(jié)束標(biāo)簽>

  • 每個(gè)組件都包含一些公用屬性

  • 官方的闡述

    https://developers.weixin.qq.com/miniprogram/dev/component/

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

view視圖組件
  • view 組件
    >用的最多的,也是之前的樣例也講過。https://developers.weixin.qq.com/miniprogram/dev/component/view.html

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

  • 演示用例

<!--view.wxml-->

<!--手機(jī)按住1秒變成灰色,手指松開后2秒變回原來的紅色-->
<view?class="container"?hover-class='hover-class'?hover-start-time="10000"?hover-stay-time="2000">
</view>
.container{
??background-color:?red;
}

.hover-class{
??background-color:?gray;
}

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

scroll-view 視圖組件
  • 官網(wǎng)的介紹
    >https://developers.weixin.qq.com/miniprogram/dev/component/scroll-view.html

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

  • 演示

<!--scroll-view.wxml-->
<scroll-view?class="container-wrapp"?style='height:300rpx'?scroll-y='true'
bindscrolltoupper="scrolltoupper"
bindscrolltolower="scrolltolower"
upper-threshold="0"
lower-threshold="0"
scroll-top="100"
enable-back-to-top="true"
scroll-with-animation="true"
bindscroll="scroll"
scroll-into-view="b"
>
??<view?id="a"?class='sizeY?a'>a</view>
??<view?id="b"?class='sizeY?b'>b</view>
??<view?id="c"?class='sizeY?c'>c</view>
??<view?id="d"?class='sizeY?d'>d</view>
??<view?id="e"?class='sizeY?e'>e</view>
</scroll-view>


<scroll-view?class="container-nowrap"?style='margin-top:250rpx'?scroll-x='true'?scroll-left="200">
??<view?id="a"?class='sizeX?a'>a</view>
??<view?id="b"?class='sizeX?b'>b</view>
??<view?id="c"?class='sizeX?c'>c</view>
??<view?id="d"?class='sizeX?d'>d</view>
??<view?id="e"?class='sizeX?e'>e</view>
</scroll-view>
//scroll-view.js
//獲取應(yīng)用實(shí)例

Page({
??scrolltoupper:function(){
??????console.log("滾動(dòng)到頂部");
??},
??scrolltolower:function(){
??????console.log("滾動(dòng)到底部");
??},
??scroll:function(){
????console.log("滾動(dòng)中。。。");
??}

})
.container-wrap{
??display:?flex;
??flex-wrap:wrap;
}

.container-nowrap{
??display:flex;
??white-space:?nowrap;
}

.sizeY{
??width:?100%;
??height:?150rpx;
}

.sizeX{
??width:?250rpx;
??height:?150px;
??display:?inline-block;
}
.a?{
??background:?red;
}
.b?{
??background:?yellow;
}

.c?{
??background:?blue;
}

.d?{
??background:?green;
}

.e?{
??background:?gold;
}

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

注意:enable-back-to-top=”true” 在開發(fā)工具沒辦法演示只能在手機(jī)上才能演示出來點(diǎn)擊直接到達(dá)頂部的效果。關(guān)于scrollview 只有橫向和縱向,其實(shí)這塊還是比較重要的多加練習(xí)吧。

swiper組件
  • 俗稱 輪播圖

  • 官方介紹
    >https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

  • 演示

<!--swiper.wxml-->
<swiper?indicator-dots="{{indicatorDots}}"
??autoplay="{{autoplay}}"?interval="{{interval}}"?duration="{{duration}}">
??<block?wx:for="{{imgUrls}}">
????<swiper-item>
??????<image?src="{{item}}"?class="slide-image"?width="355"?height="150"/>
????</swiper-item>
??</block>
</swiper>
<button?bindtap="changeIndicatorDots">?indicator-dots?</button>
<button?bindtap="changeAutoplay">?autoplay?</button>
<slider?bindchange="intervalChange"?show-value?min="500"?max="2000"/>?interval
<slider?bindchange="durationChange"?show-value?min="1000"?max="10000"/>?duration
//swiper.js
//獲取應(yīng)用實(shí)例

Page({
??data:?{
????imgUrls:?[
??????'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
??????'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
??????'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
????],
????indicatorDots:?false,
????autoplay:?false,
????interval:?5000,
????duration:?1000
??},
??changeIndicatorDots:?function?(e)?{
????this.setData({
??????indicatorDots:?!this.data.indicatorDots
????})
??},
??changeAutoplay:?function?(e)?{
????this.setData({
??????autoplay:?!this.data.autoplay
????})
??},
??intervalChange:?function?(e)?{
????this.setData({
??????interval:?e.detail.value
????})
??},
??durationChange:?function?(e)?{
????this.setData({
??????duration:?e.detail.value
????})
??}
})

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

  • 演示

<!--movable.wxml-->

<movable-area?class="container">
??<movable-view?class='size'?direction='all'?inertia='true'?out-of-bounds='true'?x='50'?y='50'
??damping='100'?friction='100'?bindchange='onchange'?bindscale='onscale'?scale="true">
??</movable-view>
</movable-area>
.container{
??background-color:?red;
??width:?100%;
??height:?650rpx;
}

.size{
??background-color:?yellow;
??width:?300rpx;
??height:?250rpx;
}
//movable.js
//獲取應(yīng)用實(shí)例

Page({
??onchange:function(){
????console.log("在移動(dòng)。。");
??},
??onscale:function(){
????console.log("在縮放")
??}
})

「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)

PS:跟老鐵一起過了一遍wx小程序關(guān)于視圖的api,感覺還是組件很豐富,很好用!

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

分享題目:「小程序JAVA實(shí)戰(zhàn)」小程序的組件(23)-創(chuàng)新互聯(lián)
鏈接URL:http://jinyejixie.com/article2/jsgic.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、品牌網(wǎng)站建設(shè)、品牌網(wǎng)站設(shè)計(jì)、域名注冊(cè)、搜索引擎優(yōu)化品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)
临清市| 泊头市| 尼勒克县| 乐至县| 巴林左旗| 龙岩市| 许昌市| 淄博市| 邵阳市| 綦江县| 合肥市| 大同市| 纳雍县| 岳阳市| 迁西县| 宜宾县| 湖口县| 阿拉善左旗| 望都县| 沅江市| 连南| 呼玛县| 广安市| 囊谦县| 东宁县| 洛阳市| 那曲县| 米脂县| 镇沅| 石河子市| 濮阳县| 万年县| 老河口市| 镇远县| 安福县| 厦门市| 土默特右旗| 开封市| 平陆县| 察隅县| 柘城县|