fixed FormItem label slot bug

This commit is contained in:
梁灏 2017-08-09 17:06:05 +08:00
parent 53a6915a94
commit f3c6cd68d1
2 changed files with 3 additions and 2 deletions

View file

@ -1,6 +1,7 @@
<template> <template>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80"> <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<Form-item label="姓名" prop="name"> <Form-item prop="name">
<span slot="label"><Icon type="ionic"></Icon></span>
<Input v-model="formValidate.name" placeholder="请输入姓名"></Input> <Input v-model="formValidate.name" placeholder="请输入姓名"></Input>
</Form-item> </Form-item>
<Form-item label="邮箱" prop="mail"> <Form-item label="邮箱" prop="mail">

View file

@ -1,6 +1,6 @@
<template> <template>
<div :class="classes"> <div :class="classes">
<label :class="[prefixCls + '-label']" :style="labelStyles" v-if="label"><slot name="label">{{ label }}</slot></label> <label :class="[prefixCls + '-label']" :style="labelStyles" v-if="label || $slots.label"><slot name="label">{{ label }}</slot></label>
<div :class="[prefixCls + '-content']" :style="contentStyles"> <div :class="[prefixCls + '-content']" :style="contentStyles">
<slot></slot> <slot></slot>
<transition name="fade"> <transition name="fade">