js實(shí)現(xiàn)移動(dòng)端簡易滑動(dòng)表格_第1頁
js實(shí)現(xiàn)移動(dòng)端簡易滑動(dòng)表格_第2頁
js實(shí)現(xiàn)移動(dòng)端簡易滑動(dòng)表格_第3頁
js實(shí)現(xiàn)移動(dòng)端簡易滑動(dòng)表格_第4頁
js實(shí)現(xiàn)移動(dòng)端簡易滑動(dòng)表格_第5頁
已閱讀5頁,還剩1頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

第js實(shí)現(xiàn)移動(dòng)端簡易滑動(dòng)表格本文實(shí)例為大家分享了js實(shí)現(xiàn)移動(dòng)端簡易滑動(dòng)表格的具體代碼,供大家參考,具體內(nèi)容如下

上js文件代碼

template

view

scroll-viewscroll-x="true"

view

view

viewv-for="(item,i)inthList":key="i"{{

item

}}/view

/view

!--這里會(huì)自動(dòng)遍歷出對(duì)象數(shù)組中的數(shù)據(jù)--

viewv-if="!useCusTdList"

viewv-for="(item,n)intdData":key="n"

viewv-for="(val,key,i)initem":key="i+n"{{

val

}}/view

/view

/view

!--這里會(huì)使用tdList中定義的字段的數(shù)據(jù)--

viewv-if="useCusTdList"

viewv-for="(item,n)intdData":key="n"

viewv-for="(tdName,i)intdList":key="i+n"

viewv-if="!slotData"{{item[tdName]}}/view

viewv-else

slot

name="scoped"

:row="{value:item[tdName],key:tdName}"

/slot

/view

/view

/view

/view

/view

!--撐開空間,防止最后一行的下邊框無法顯示--

view/view

/scroll-view

/view

/template

script

exportdefault{

name:'CusTable',

props:{

thList:{

type:Array,

default:function(){

return[]

}

},

tdList:{

type:Array,

default:function(){

return[]

}

},

tdData:{

type:Array,

default:function(){

return[]

}

},

useCusTdList:{

useCusTdList:Boolean,

default:false

},

slotData:{//是否使用插槽

useCusTdList:Boolean,

default:false

}

},

data(){

return{}

},

methods:{}

/script

stylelang="scss"

/*scroll-view樣式*/

.scroll-table{

min-height:100rpx;

white-space:nowrap;

//padding:10rpx20rpx;

//margin-top:30rpx;

padding-bottom:60rpx;

.scroll-tr{

min-width:750rpx;

display:inline-block;

/*表頭樣式*/

.cus-th{

background-color:#f3f3f3;

}

/*行樣式*/

.cus-tr{

box-sizing:border-box;

display:flex;

flex-direction:row;

flex-wrap:nowrap;

justify-content:flex-start;

align-items:stretch;

align-content:center;

height:100%;

/*設(shè)置邊框*/

border-color:#ccc;

border-style:solid;

border-width:0;

border-top-width:1px;

border-left-width:1px;

border-bottom-width:1px;

color:#333;

+.cus-tr{

border-top-style:none;

}

/*表格樣式*/

.cus-td{

width:220rpx;

box-sizing:border-box;

padding:1px;

font-size:25rpx;

word-break:break-all;

border-color:#ccc;

border-style:solid;

border-width:0;

border-right-width:1px;

min-height:60rpx;

white-space:pre-wrap;

word-wrap:break-word;

/**/

display:flex;

justify-content:center;//左右居中

align-items:center;//上下居中

/*跨列*/

-colspan{

flex-grow:1;

width:0;

}

/*內(nèi)容頂部對(duì)齊*/

-top{

align-items:flex-start;

align-content:flex-start;

}

/*內(nèi)容底部對(duì)齊*/

-bottom{

align-items:flex-end;

align-content:flex-end;

}

/*內(nèi)容左邊對(duì)齊*/

-left{

justify-content:flex-start;

}

/*內(nèi)容右邊對(duì)齊*/

-right{

justify-cont

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論