mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-07 09:38:44 +08:00
fix: 🐛 修复search组件suffix插槽无法使用的问题
This commit is contained in:
parent
5fb9542087
commit
6a4af41b93
@ -157,7 +157,7 @@ function changeSearchType({ item, index }) {
|
|||||||
## Attributes
|
## Attributes
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
|
||||||
| ---------------- | ------------------------------------- | --------------- | ------ | ------ | -------- |
|
| ------------------- | ----------------------------------------------------------------------------------------- | --------------- | ------ | ------ | -------- |
|
||||||
| placeholder | 搜索框占位文本 | string | - | 搜索 | - |
|
| placeholder | 搜索框占位文本 | string | - | 搜索 | - |
|
||||||
| placeholder-left | placeholder 居左边 | boolean | - | false | - |
|
| placeholder-left | placeholder 居左边 | boolean | - | false | - |
|
||||||
| cancel-txt | 搜索框右侧文本 | string | - | 取消 | - |
|
| cancel-txt | 搜索框右侧文本 | string | - | 取消 | - |
|
||||||
@ -166,7 +166,7 @@ function changeSearchType({ item, index }) {
|
|||||||
| disabled | 是否禁用搜索框 | boolean | - | false | - |
|
| disabled | 是否禁用搜索框 | boolean | - | false | - |
|
||||||
| maxlength | 原生属性,设置最大长度。-1 表示无限制 | string / number | - | -1 | - |
|
| maxlength | 原生属性,设置最大长度。-1 表示无限制 | string / number | - | -1 | - |
|
||||||
| v-model | 输入框内容,双向绑定 | string | - | - | - |
|
| v-model | 输入框内容,双向绑定 | string | - | - | - |
|
||||||
| use-suffix-slot | 是否使用输入框右侧插槽 | boolean | - | false | - |
|
| ~~use-suffix-slot~~ | ~~是否使用输入框右侧插槽~~**(已废弃,将在下一个 minor 版本被移除,直接使用插槽即可)** | boolean | - | false | - |
|
||||||
| focus | 是否自动聚焦 | boolean | - | false | 0.1.63 |
|
| focus | 是否自动聚焦 | boolean | - | false | 0.1.63 |
|
||||||
| focusWhenClear | 是否在点击清除按钮时聚焦输入框 | boolean | - | false | 0.1.63 |
|
| focusWhenClear | 是否在点击清除按钮时聚焦输入框 | boolean | - | false | 0.1.63 |
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ function changeSearchType({ item, index }) {
|
|||||||
| name | 说明 | 最低版本 |
|
| name | 说明 | 最低版本 |
|
||||||
| ------ | -------------------- | -------- |
|
| ------ | -------------------- | -------- |
|
||||||
| prefix | 输入框左侧自定义内容 | - |
|
| prefix | 输入框左侧自定义内容 | - |
|
||||||
| suffix | 输入框左侧自定义内容 | - |
|
| suffix | 输入框右侧自定义内容 | - |
|
||||||
|
|
||||||
## 外部样式类
|
## 外部样式类
|
||||||
|
|
||||||
|
|||||||
@ -14,8 +14,9 @@ export const searchProps = {
|
|||||||
* 是否使用输入框右侧插槽
|
* 是否使用输入框右侧插槽
|
||||||
* 类型: boolean
|
* 类型: boolean
|
||||||
* 默认值: false
|
* 默认值: false
|
||||||
|
* @deprecated 该属性已废弃,将在下一个minor版本被移除,直接使用插槽即可
|
||||||
*/
|
*/
|
||||||
userSuffixSlot: makeBooleanProp(false),
|
useSuffixSlot: makeBooleanProp(false),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索框占位文本
|
* 搜索框占位文本
|
||||||
|
|||||||
@ -32,14 +32,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!--the button behind input,care for hideCancel without displaying-->
|
<!--the button behind input,care for hideCancel without displaying-->
|
||||||
<block v-if="!hideCancel">
|
|
||||||
<!--有插槽就不用默认的按钮了-->
|
<slot v-if="!hideCancel" name="suffix">
|
||||||
<slot v-if="userSuffixSlot" name="suffix"></slot>
|
|
||||||
<!--默认button-->
|
<!--默认button-->
|
||||||
<view v-else class="wd-search__cancel" @click="handleCancel">
|
<view class="wd-search__cancel" @click="handleCancel">
|
||||||
{{ cancelTxt || translate('cancel') }}
|
{{ cancelTxt || translate('cancel') }}
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</slot>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user