Skip to content

Commit

Permalink
新增 easyinput左侧插槽:left
Browse files Browse the repository at this point in the history
  • Loading branch information
18148764734 committed Feb 21, 2024
1 parent 6f16909 commit 6dcf1d6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
34 changes: 18 additions & 16 deletions pages/vue/easyinput/easyinput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,26 @@

<uni-section title="图标" subTitle="使用 prefixIcon / suffixIcon 属性 ,可以自定义输入框左右侧图标" type="line" padding>
<uni-easyinput prefixIcon="search" v-model="value" placeholder="左侧图标" @iconClick="iconClick">
<template #left></template>
</uni-easyinput>
<uni-easyinput class="uni-mt-5" suffixIcon="search" v-model="value" placeholder="右侧图标"
@iconClick="iconClick">
<uni-easyinput class="uni-mt-5" suffixIcon="search" v-model="value" placeholder="右侧图标" @iconClick="iconClick">
</uni-easyinput>
</uni-section>


<uni-section title="插槽" subTitle="使用 prefixIcon / suffixIcon 插槽 ,可以自定义输入框左右侧内容" type="line" padding>
<uni-easyinput v-model="value" placeholder="请输入网址">
<template #prefixIcon>
<view
style="background-color: #f2f2f2;padding: 0 10rpx;height: 70rpx;line-height: 70rpx;margin-right: 10rpx;">
https://</view>
</template>
</uni-easyinput>
<uni-easyinput class="uni-mt-5" prefixIcon="search" v-model="value" placeholder="想看什么,搜索一下">
<template #suffixIcon>
<button class="uni-btn uni-btn-mini uni-btn-radius" type="primary" size="mini">搜索</button>
</template>
</uni-easyinput>
</uni-section>


<uni-section title="插槽" subTitle="使用 prefixIcon / suffixIcon 插槽 ,可以自定义输入框左右侧内容" type="line" padding>
<uni-easyinput v-model="value" placeholder="请输入网址">
<template #prefixIcon>
<view style="background-color: #f2f2f2;padding: 0 10rpx;height: 70rpx;line-height: 70rpx;margin-right: 10rpx;">https://</view>
</template>
</uni-easyinput>
<uni-easyinput class="uni-mt-5" prefixIcon="search" v-model="value" placeholder="想看什么,搜索一下">
<template #suffixIcon>
<button class="uni-btn uni-btn-mini uni-btn-radius" type="primary" size="mini">搜索</button>
</template>
</uni-easyinput>
</uni-section>


Expand Down
2 changes: 2 additions & 0 deletions uni_modules/uni-easyinput/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.1.15(2024-02-21)
- 新增 左侧插槽:left
## 1.1.14(2024-02-19)
- 修复 onBlur的emit传值错误
## 1.1.12(2024-01-29)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<view class="uni-easyinput" :class="{ 'uni-easyinput-error': msg }" :style="boxStyle">
<view class="uni-easyinput__content" :class="inputContentClass" :style="inputContentStyle">
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')" size="22"></uni-icons>
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')" size="22"></uni-icons>
<slot name="left">
</slot>
<textarea
v-if="type === 'textarea'"
class="uni-easyinput__content-textarea"
Expand Down Expand Up @@ -46,6 +48,7 @@
@confirm="onConfirm"
@keyboardheightchange="onkeyboardheightchange"
/>

<template v-if="type === 'password' && passwordIcon">
<!-- 开启密码时显示小眼睛 -->
<uni-icons
Expand Down
2 changes: 1 addition & 1 deletion uni_modules/uni-easyinput/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "uni-easyinput",
"displayName": "uni-easyinput 增强输入框",
"version": "1.1.14",
"version": "1.1.15",
"description": "Easyinput 组件是对原生input组件的增强",
"keywords": [
"uni-ui",
Expand Down

0 comments on commit 6dcf1d6

Please sign in to comment.