微信小程式開發筆記 05

2021-09-11 04:40:58 字數 2254 閱讀 5357

/* pages/list/list.wxss */

.loadmore

bindtap

='loadmore'

data-lastid

="}"

class

='loadmore'

>

載入更多view

>

//獲取應用例項

介面反饋提示

page(,

loaddata: function (lastid) )

return false

}var len = res.data.length

if (len != 0) )

} else )

}var dataarr = that.data.newslist

var newdata = dataarr.concat(res.data);

that.setdata()

}})},

loadmore: function (event) )

} }})

this.setdata()

this.loaddata(id);

},//訊息提示框

toastchange: function () )

},//網路狀態模式提示框

modalchange: function () )}})

bindtap

='loadmore'

data-lastid

="}"

data-isfrist

="}"

class

='loadmore'

>

載入更多view

>

hidden

="}"

bindchange

="toastchange"

duration

="3000"

>

}toast

>

title

= no-cancel

hidden

="}"

confirm-text

="確定"

bindconfirm

="modalchange"

>

你當前不在wifi網路下,

會產生流量費用modal

設定「載入中「」提示框方法一:

hidden

="}"

bindchange

="loadchange"

>

載入中...

loading

>

data: 

loaddata: function (lastid) )

}

complete: function () )

}

方法二:

微信小程式開發筆記

元件開發 1 與vue 元件用法類似。a 建立元件 小程式中的元件與普通頁面目錄相同,例如需要建立乙個名為 component 的元件。首先建立乙個目錄為 component 的目錄,由 component.wxss component.wxml component.js component.jso...

微信小程式 雲開發筆記

獲取集合內所有的資料,一般只能獲取20條 db.collection 集合名 get then res 獲取集合內具體id的資料 db.collection 集合名 doc id get then res 3.獲取progress大於等於50的資料 const a db.command db.col...

微信小程式開發筆記(三) 模板

為什麼要用模板呢?當多個頁面需要有一樣的元件時,使用模板會比較方便。table of contents 一 定義模板 使用模板 二 使用模板 三 列表渲染 模板 頁面傳值 1.列表渲染 2.template.wxml裡的模板 頁面傳值 3.js中的事件定義 使用 name 屬性,作為模板的名字。然後...