uu
This commit is contained in:
parent
19cf6090a9
commit
58c7de9557
@ -1,9 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<u-row justify="between" align="top">
|
||||||
|
<view style="flex: 1 0 0;">
|
||||||
<tpx-checkitems :list="list" :type="type" :value="value" v-slot="current" item-style="display:inline-block;"
|
<tpx-checkitems :list="list" :type="type" :value="value" v-slot="current" item-style="display:inline-block;"
|
||||||
:min-checked="minChecked" @onItemClick="handleoItemClick" @onChange="handleChange"
|
:min-checked="minChecked" @onItemClick="handleoItemClick" @onChange="handleChange"
|
||||||
>
|
>
|
||||||
<view slot class="smp-tag">
|
<view v-if="(maxShowNum >= current.index +1) || showAll" slot class="smp-tag">
|
||||||
<u-tag :text="`${current.item.title}`" :plain="!current.checked" :type="mode"
|
<u-tag :text="`${current.item.title}`" :plain="!current.checked" :type="mode"
|
||||||
border-color="transparent" shape="circle" :bg-color="`${(current.checked || (mode == 'primary'))?activeColor:color}`"
|
border-color="transparent" shape="circle" :bg-color="`${(current.checked || (mode == 'primary'))?activeColor:color}`"
|
||||||
:color="`${(current.checked || (mode == 'primary'))?'#fff':'#666'}`"
|
:color="`${(current.checked || (mode == 'primary'))?'#fff':'#666'}`"
|
||||||
@ -14,6 +15,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</tpx-checkitems>
|
</tpx-checkitems>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="list.length > maxShowNum && maxShowNum > 0 && !showAll" style="padding: 6rpx;" @click="handleShowMore">
|
||||||
|
<span class="font-24" style="padding-right: 6rpx;">更多</span>
|
||||||
|
<span class="iconfont icon-arrow-down"></span>
|
||||||
|
</view>
|
||||||
|
</u-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -27,6 +33,7 @@
|
|||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
},
|
},
|
||||||
|
|
||||||
// ======================== 分割线, 上方是 tpx-checkitems属性 ======================
|
// ======================== 分割线, 上方是 tpx-checkitems属性 ======================
|
||||||
closable: {
|
closable: {
|
||||||
default () {
|
default () {
|
||||||
@ -48,11 +55,15 @@
|
|||||||
return '#de524e'
|
return '#de524e'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
maxShowNum: {
|
||||||
|
default () {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showAll: !(this.maxShowNum > 0)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -75,6 +86,9 @@
|
|||||||
handleChange(val) {
|
handleChange(val) {
|
||||||
this.$emit('onChange', val)
|
this.$emit('onChange', val)
|
||||||
this.$emit('update:value', val)
|
this.$emit('update:value', val)
|
||||||
|
},
|
||||||
|
handleShowMore(){
|
||||||
|
this.showAll = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user