Skip to content

Commit

Permalink
fix(select): fix default value missing (#3177)
Browse files Browse the repository at this point in the history
* fix(select): fix default value missing

* chore: update snapshot
  • Loading branch information
uyarn committed May 16, 2024
1 parent 96d023c commit 789a585
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
21 changes: 10 additions & 11 deletions src/select/__tests__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`Select > :props > :bordered 1`] = `
class="t-select__wrap"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -55,7 +55,7 @@ exports[`Select > :props > :clearable 1`] = `
class="t-select__wrap"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -104,7 +104,7 @@ exports[`Select > :props > :creatable 1`] = `
class="t-select__wrap"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -153,7 +153,7 @@ exports[`Select > :props > :disabled 1`] = `
class="t-select__wrap"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand All @@ -170,7 +170,6 @@ exports[`Select > :props > :disabled 1`] = `
disabled="disabled"
placeholder="请选择"
readonly="readonly"
title="false"
type="text"
unselectable="on"
/>
Expand Down Expand Up @@ -204,7 +203,7 @@ exports[`Select > :props > :labelInValue 1`] = `
class="t-select__wrap"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -253,7 +252,7 @@ exports[`Select > :props > :loading 1`] = `
class="t-select__wrap"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -365,7 +364,7 @@ exports[`Select > :props > :placeholder 1`] = `
class="t-select__wrap"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -415,7 +414,7 @@ exports[`Select > :props > :remote 1`] = `
remote="true"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -464,7 +463,7 @@ exports[`Select > :props > :reserveKeyword 1`] = `
class="t-select__wrap"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -513,7 +512,7 @@ exports[`Select > :props > :size 1`] = `
class="t-select__wrap"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down
7 changes: 6 additions & 1 deletion src/select/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ export default {
type: Object as PropType<TdSelectProps['popupProps']>,
},
/** 是否显示下拉框 */
popupVisible: Boolean,
popupVisible: {
type: Boolean,
default: undefined,
},
/** 是否显示下拉框,非受控属性 */
defaultPopupVisible: Boolean,
/** 组件前置图标 */
Expand Down Expand Up @@ -159,10 +162,12 @@ export default {
/** 选中值 */
value: {
type: [String, Number, Boolean, Object, Array] as PropType<TdSelectProps['value']>,
default: undefined,
},
/** 选中值,非受控属性 */
defaultValue: {
type: [String, Number, Boolean, Object, Array] as PropType<TdSelectProps['defaultValue']>,
default: undefined,
},
/** 自定义选中项呈现的内容 */
valueDisplay: {
Expand Down
8 changes: 4 additions & 4 deletions test/snap/__snapshots__/csr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -37164,7 +37164,7 @@ exports[`csr snapshot test > csr test ./src/config-provider/_example/others.vue
style="width: 400px;"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -37218,7 +37218,7 @@ exports[`csr snapshot test > csr test ./src/config-provider/_example/others.vue
style="width: 400px;"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -37272,7 +37272,7 @@ exports[`csr snapshot test > csr test ./src/config-provider/_example/others.vue
style="width: 400px;"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down Expand Up @@ -88235,7 +88235,7 @@ exports[`csr snapshot test > csr test ./src/select/_example/scroll-bottom.vue 1`
style="width: 300px;"
>
<div
class="t-select-input t-select"
class="t-select-input t-select-input--empty t-select"
>
<div
class="t-input__wrap"
Expand Down
Loading

0 comments on commit 789a585

Please sign in to comment.