Form add show-message support

Form add show-message support
This commit is contained in:
梁灏 2017-01-16 20:09:18 +08:00
parent 071506fc66
commit 6986d05501
4 changed files with 10 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 164 KiB

View file

@ -3,7 +3,7 @@
<label :class="[prefixCls + '-label']" :style="labelStyles" v-if="label">{{ label }}</label>
<div :class="[prefixCls + '-content']" :style="contentStyles">
<slot></slot>
<div transition="fade" :class="[prefixCls + '-error-tip']" v-if="validateState === 'error'">{{ validateMessage }}</div>
<div transition="fade" :class="[prefixCls + '-error-tip']" v-if="validateState === 'error' && showMessage && form.showMessage">{{ validateMessage }}</div>
</div>
</div>
</template>
@ -61,6 +61,10 @@
},
validateStatus: {
type: Boolean
},
showMessage: {
type: Boolean,
default: true
}
},
data () {

View file

@ -28,6 +28,10 @@
inline: {
type: Boolean,
default: false
},
showMessage: {
type: Boolean,
default: true
}
},
data () {

View file

@ -5,7 +5,7 @@
<Icon type="ios-person-outline" slot="prepend"></Icon>
</i-input>
</Form-item>
<Form-item prop="password">
<Form-item prop="password" :show-message="false">
<i-input type="password" :value.sync="formInline.password" placeholder="Password">
<Icon type="ios-locked-outline" slot="prepend"></Icon>
</i-input>