Skip to content

Commit

Permalink
fix: fix Lightbox/Carousel slot and fix Cascader demo bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaodemen authored and Justineo committed May 7, 2021
1 parent fb74f16 commit 183098f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/veui/demo/cases/Cascader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<veui-checkbox v-model="clearable1">Clearable</veui-checkbox>
<veui-checkbox v-model="inline1">Inline</veui-checkbox>
<veui-checkbox
v-model="verboseBackfill1"
v-model="valueDisplay1"
true-value="complete"
false-value="simple"
>逐级展示</veui-checkbox>
Expand All @@ -40,7 +40,7 @@
:select-mode="selectMode1"
:column-trigger="trigger1"
:clearable="clearable1"
:value-display="verboseBackfill1"
:value-display="valueDisplay1"
:inline="inline1"
:column-width="getRealColumnWidth(columnWidth1)"
/>
Expand Down Expand Up @@ -218,12 +218,12 @@ export default {
value1: null,
expanded1: false,
searchable1: true,
selectMode1: false,
selectMode1: 'leaf-only',
trigger1: 'click',
clearable1: true,
inline1: false,
columnWidth1: '',
verboseBackfill1: false,
valueDisplay1: 'simple',
value2: null,
expanded2: false,
Expand Down
1 change: 1 addition & 0 deletions packages/veui/src/components/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
>
<slot
v-if="realIndex === i || isPreload(i)"
name="item"
v-bind="{ ...item, preload: isPreload(i) }"
:index="i"
>
Expand Down
4 changes: 2 additions & 2 deletions packages/veui/src/components/Cascader/Cascader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default {
options = this.realShowSelectAll
? [{ label: this.t('selectAll'), position: 'inline', options }]
: options
return this.markChecked(options, this.value)
return this.markChecked(options, this.realValue)
},
rootAttrs () {
return {
Expand Down Expand Up @@ -599,7 +599,7 @@ export default {
option = parents[parents.length - 1]
parents = parents.slice(1)
let newValues = this[`${operation}Item`](
this.value,
this.realValue,
option,
parents,
this.realOptions
Expand Down
6 changes: 5 additions & 1 deletion packages/veui/src/components/Lightbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<div :class="$c('lightbox-item-content-container')">
<slot
v-if="realIndex === i || isPreload(i)"
name="item"
v-bind="{ ...item, preload: isPreload(i) }"
:index="i"
>
Expand All @@ -99,7 +100,10 @@
>
</div>
</slot>
<slot :desc="item">
<slot
name="desc"
v-bind="{ ...item, index: i }"
>
<div :class="$c('lightbox-item-desc')">
{{ item.desc }}
</div>
Expand Down

0 comments on commit 183098f

Please sign in to comment.