微信小程式封裝可以遮住表頭的元件(遮罩層)

2021-10-04 07:25:46 字數 1185 閱讀 6200

元件 html

}}

}}}}

元件css

.pop-main 

.mask

.modal-mask

.modal-dialog

.modal-content

.modal-content2

.modal-footer

.modal-footer2

.btn-cancel

.borders

.btn-confirm

.btn-common

.wx-popup-title

.wrap

.wrap2

元件json

}

元件js

component(,

/*** 元件的屬性列表

*/properties: ,

// 彈窗內容

content: ,

// 彈窗取消按鈕文字

btnno: ,

// 彈窗確認按鈕文字

btnok:

},/**

* 元件的初始資料

*/data: ,

attached: function () ,

/*** 元件的方法列表

*/methods: ,

//隱藏彈框

hidepopup: function () )

},//展示彈框

showpopup() )

},isshow() ,

/** 內部私有方法建議以下劃線開頭

* triggerevent 用於觸發事件

*/_error() ,

_success()

}})

引用這個元件

1.html

2.json"showmodal": "./../components/showmodal/showmodal"

3.jsthis.showmodal = this.selectcomponent("#showmodal"); this.setdata() this.showmodal.showpopup();

微信小程式固定表頭

採用scroll view巢狀,實現滾動 時,表頭不停留在頁面頂部。主要是在js中指定tbody的高度 視窗可用高度減去要保留的高度 表頭,或表頭 標題 wxml 本公司共發生 例風險事件 營業單位 風險事件 n發生次數 損失金額 rcsa評分結果 wxss table title table tb...

微信小程式 websocket 封裝

首先在 page 資料夾下建立乙個 js 資料夾存放封裝的 websocket 請求,其實放 看自己需要,都行。在 js 資料夾下建立乙個 websocket.js 檔案,裡面是封裝好的 websocket 其實叫啥名都行,看你心情。todo websocket封裝 wjw 2020年3月19日14...

微信小程式元件封裝

第一步,在page下面新建乙個template檔案,如下圖 第二部,在template.wxml中編寫公用元件即要封裝的 模組 template name mars view text mars text view template 第三部,在需要使用封裝的元件的wxml檔案裡引入,此步最關鍵 vi...