This commit is contained in:
cookfront 2017-03-21 18:00:31 +08:00
parent 6280c694ae
commit 1c0d395841
3 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<a class="zan-cell" :href="url" @click="handleClick"> <a class="zan-cell" :href="url" @click="handleClick">
<div :class="{ 'zan-cell__title': true, 'zan-cell__required': required }"> <div :class="{ 'zan-cell__title': true, 'zan-cell__required': required }" v-if="this.$slots.title || title || label">
<slot name="icon"> <slot name="icon">
<i v-if="icon" class="zan-icon" :class="'zan-icon-' + icon"></i> <i v-if="icon" class="zan-icon" :class="'zan-icon-' + icon"></i>
</slot> </slot>

View File

@ -16,6 +16,7 @@
ref="textareaElement" ref="textareaElement"
class="zan-field__control" class="zan-field__control"
v-model="currentValue" v-model="currentValue"
@focus="handleInputFocus"
:placeholder="placeholder" :placeholder="placeholder"
:maxlength="maxlength" :maxlength="maxlength"
:disabled="disabled" :disabled="disabled"
@ -28,6 +29,7 @@
class="zan-field__control" class="zan-field__control"
:value="currentValue" :value="currentValue"
@input="handleInput" @input="handleInput"
@focus="handleInputFocus"
:type="type" :type="type"
:placeholder="placeholder" :placeholder="placeholder"
:maxlength="maxlength" :maxlength="maxlength"
@ -104,6 +106,10 @@ export default {
// 0 scrollHeight // 0 scrollHeight
textareaElement.style.height = 0 + 'px'; textareaElement.style.height = 0 + 'px';
textareaElement.style.height = (textareaElement.scrollHeight - textAreaDiff) + 'px'; textareaElement.style.height = (textareaElement.scrollHeight - textAreaDiff) + 'px';
},
handleInputFocus() {
this.$emit('focus');
} }
} }
}; };

View File

@ -65,7 +65,7 @@
} }
@when alone { @when alone {
float: left; float: none;
} }
} }