Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | 7x 7x 7x 7x 7x | <template>
<u-linear-layout :class="$style.root" direction="vertical" gap="small">
<div v-for="(category, level) in categories" :key="level">
<span :class="$style.label">{{ category.label }}</span>
<u-capsules :class="$style.capsules" :field="field" :cancelable="cancelable" :readonly="readonly" :disabled="disabled"
v-model="values[level]" @select="onSelect($event, level)">
<u-capsule v-for="item in lists[level]" v-if="item.exist === undefined || !!item.exist === true"
:key="item.value"
:value="item.value"
:item="item"
:label="item.label"
:disabled="item.disabled">
<slot name="text" :item="item" :level="level">{{ $at(item, field) }}</slot>
</u-capsule>
</u-capsules>
<span :class="$style.tip" v-if="category.tip">{{ category.tip }}</span>
</div>
</u-linear-layout>
</template>
<script>
import UCascadeSelect from '../u-cascade-select.vue';
export default {
name: 'u-cascade-capsules',
extends: UCascadeSelect,
props: { cancelable: { type: Boolean, default: false } },
};
</script>
<style module>
.label {
display: inline-block;
width: 60px;
color: var(--color-light);
margin-top: 4px;
}
.root[label-size="small"] .label {
width: 40px;
}
.root[label-size="large"] .label {
width: 120px;
}
.capsules {
max-width: calc(100% - 60px);
vertical-align: top;
}
.tip {
margin-left: 20px;
color: var(--color-light);
}
</style>
|