Merge remote-tracking branch 'main/dev' into dev

This commit is contained in:
陈嘉涵
2017-08-18 14:47:19 +08:00
7 changed files with 49 additions and 6 deletions
+18 -2
View File
@@ -9,7 +9,8 @@
'van-field--disabled': disabled,
'van-field--error': error,
'van-field--border': border,
'van-field--autosize': autosize
'van-field--autosize': autosize,
'van-field--has-icon': showIcon
}">
<textarea
v-if="type === 'textarea'"
@@ -37,7 +38,11 @@
:maxlength="maxlength"
:disabled="disabled"
:readonly="readonly">
<van-icon v-if="icon && currentValue" :name="icon" class="van-field__icon" @click="onIconClick"></van-icon>
<div v-if="showIcon" class="van-field__icon" @click="onIconClick">
<slot name="icon">
<van-icon :name="icon"></van-icon>
</slot>
</div>
</van-cell>
</template>
@@ -101,6 +106,17 @@ export default {
}
},
computed: {
showIcon() {
// 有icon的slot,就认为一直展示
if (this.$slots.icon) {
return true;
}
return this.icon && this.currentValue;
}
},
methods: {
handleInput(event) {
this.currentValue = event.target.value;
+1 -1
View File
@@ -37,7 +37,7 @@ import Swipe from './swipe';
import SwipeItem from './swipe-item';
import DatetimePicker from './datetime-picker';
const version = '0.8.0';
const version = '0.8.1';
const components = [
Button,
Switch,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "vant-css",
"version": "0.8.0",
"version": "0.8.1",
"description": "vant css.",
"main": "lib/index.css",
"style": "lib/index.css",
+6
View File
@@ -78,6 +78,12 @@
}
}
&--has-icon {
.van-field__control {
width: 90%;
}
}
&__control {
border: 0;
font-size: 14px;