一本色道久久综合狠狠躁篇|亚洲av无码一区二区乱子伦as|亚洲国产成AV人天堂无码|亚洲狠狠婷婷综合久久蜜芽|狠狠做五月深爱婷婷|人妻夜夜爽天天爽三区

歡迎來(lái)到 天津九安特機電工程有限公司
全國咨詢(xún)熱線(xiàn): 13380371518
聯(lián)系我們

地址:北京市通州區66號

電話(huà):19913167781

傳真:13386601061

郵箱:[email protected]

vue使用vant中的checkbox實(shí)現全選功能
  來(lái)源:天津九安特機電工程有限公司  更新時(shí)間:2026-05-05 05:33:56

這篇文章主要??為大ヽ(′▽?zhuān)?ノ家詳細介紹了vue使用(╯°□°)╯︵ ┻━┻vant中的使x實(shí)checkbox實(shí)現全選功能,文中示例代碼介紹的現全選功非常詳細,具有一定的使x實(shí)參考價(jià)值,感(gan)興趣的現全選功小伙伴們可以參考一下

本文實(shí)例為大家分享了vue使用vant中的checkbox實(shí)現全選功能的具體代碼,供大家參考,使x實(shí)具體內容如下

<tem(′?ω?`)plate>(°ロ°) !
<div class="visiblePeople">
<topbar />
<ul class="list clear_float">
<li v-for='(item,現全選功 index) in people' :key='index'>
<van-checkbox
v-model='item.flag'
class='listヽ(′ー`)ノli'
></van-checkbox>
<div class="right">
<p>{ { item.name }}</p>
<p>{ { item.id }}</p&gヾ(?■_■)ノt;
</div>??
</li>
</ul>
<div class="bott??om">
<div class="left">
<van-checkbox v-model='allcheck' class="all">全選</van-checkbox&??gt;
</div(????)>
<button @click="jump">確定</button>
</div>
</div>
</template>

<script>
export default {
data() {
return {
peop??ヽ(′▽?zhuān)?ノle: [
{ id: "002", name: "陳陽(yáng)"┐(′д`)┌, flag: true },
{
id: "003",
name: "王苗苗",
flag: true,
},
{
id: "004",
name: "張梁俊",
flag: true,
},
{
id: "005",
name: "劉路",
flag: true,
},
],
};
},
methods: {
//點(diǎn)擊確定后跳轉回新增合同頁(yè)面
jump() {
this.$router.push("/addContract");
},
//單選按鈕切換
// change(index) {
// this.peop??ヽ(′ー`)ノle[index].flag = !this.people[index].flag;
// console.log(this.people[index].flag);
// },
},
computed:{
allcheck:{
get(){
//取值
//every方法,??數組中每一項都滿(mǎn)足一個(gè)條件返回true
return this.people.ev??ery(item=>item.flag)
},使x實(shí)
set(newValue){
//設置值
console.log('觸發(fā)set方法')
this.people.m??ap(item=>item.flag=newValue)
}
},
filterAll(){
return this.people.filter(item=>item.flag).length
},
count()(//ω//){
let(╯°□°)╯︵ ┻━┻ checked=""List=this.people(′_`).filter(item(′▽?zhuān)?)=>item.flag)
return ch??eckedList.length.reduc??e((total,item)=>{
return total+item.num
},0)
}
}
};
</script>
<st??yle lang="l??ess" scoped>
.list {
background: #f8f9fb;
he??ight: 574px;
li {
height: 56px;
margin: 10px 0 10px 0;
float: left;
img {
width: 19px;
height: 19px;
float: left;
margin: 13px;
&.on {
display: block;
}
&a(′▽?zhuān)?mp;.off {
display: none;
}
}
.listli {
flo(??ヮ?)?*:???at: left;
margin: 19px 13px 0 13px;
}
.right {
float: left;
background: #ffffff;
width: 328px;
height: 56px;
padding: 0px 0 0 13px;
box-sizing: bor(′Д` )der-box;
p:nth-of-type(1) {
font-size: 15px;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
line-height: 29px;
}
p:nth-of-type(2) {
font-size: 13px;
font-famil??y: PingFang SC;
font-weight: 400;
color: #666666;
line-height:?? 14px;
}
}
}
}
.botto(◎_◎;)m {
height: 50px;
position: fixed;
bottom: 0;
.left {
width: 237px;
background: #ffffff??;
height: 100%;
float: left;
img {
width: 18px;??
float: left;
margin: 18px 13px 0 18px;
&.on {
display: block;
}
&.off {
display: none;
}
}
.a( ???)ll {
margin: 17px 0 0 14px;
}
p {
float: left;
font-size: 13px;
font-family: PingFang SC;
fo??(╯°□°)╯nt-weight: 400;
color: #333333;
margin-top: 18px;
}
}
button {
float: left;
width: 13??8px;
height: 50px;
line-heig(′?`*)ht: 50px;
backgro??und: #336afa;
color: #ffffff;
}
}
</style>

本次遇到的問(wèn)題是自己一開(kāi)始沒(méi)發(fā)現在people數組里面,定義的現全選功每一??項(′▽?zhuān)?flag的值設置的類(lèi)型為字符串型??即flag="true",??導致一開(kāi)始進(jìn)入頁(yè)面全部無(wú)論值為true還是false,復選框都是使x實(shí)選中效果,修改之后便沒(méi)有了此問(wèn)題?,F全選??功

關(guān)于vue.js組件的使x實(shí)教(′▽?zhuān)?程,請大家點(diǎn)擊專(zhuān)題vue.js組件學(xué)習教程進(jìn)行學(xué)??習?,F全選功

更多vue學(xué)習教程請閱(′▽?zhuān)?讀專(zhuān)題《vue??實(shí)戰教程》

以上就是使x實(shí)本文的全部?jì)热?,希望對大家的現全選功學(xué)習有所幫助,也希望大家多多支持腳本之家。使x實(shí)

來(lái)源:腳本之家

鏈接:https:ヾ(?■_■)ノ/ヽ(′ー`)ノ/www.jb51.net/??article/199892.htm

?
城市分站
友情鏈接
聯(lián)系我們

地址:上海市長(cháng)寧66號

電話(huà):18123279828

傳真:17790068725

0.9292

Copyright © 2026 Powered by 天津九安特機電工程有限公司   sitemap
一本色道久久综合狠狠躁篇|亚洲av无码一区二区乱子伦as|亚洲国产成AV人天堂无码|亚洲狠狠婷婷综合久久蜜芽|狠狠做五月深爱婷婷|人妻夜夜爽天天爽三区 河北省| 溧阳市| 钟山县| 桓台县| 潞城市| 军事| 乡城县| 青浦区| 华宁县| 长海县| 北流市| 抚宁县| 枣阳市| 曲麻莱县| 饶河县| 始兴县| 泾川县| 法库县| 十堰市| 礼泉县| 元氏县| 抚顺市| 寿宁县| 沙洋县| 平远县| 大理市| 民丰县| 策勒县| 湟中县| 岐山县| 伽师县| 吉隆县| 台江县| 南岸区| 新化县| 古田县| 衡水市| 横山县| 梅州市| 绥棱县| 乌苏市| http://444 http://444 http://444 http://444 http://444 http://444