在vue项目中使用表单组件和button按钮控件,位置影响项目运行
错误的代码如下:
<el-col :span="24">
<div class="grid-content bg-purple">
<el-form-item label="开始时间" prop="actionBeginTime">
<el-date-picker
v-model="form.actionBeginTime"
type="date"
placeholder="选择日期时间"
align="right"
clearable
></el-date-picker>
</el-form-item>
<el-button type="primary" @click="seachBtn">立即查询</el-button>
</div>
</el-col>
el-button应该包含在el-form-item内
正确的代码如下:
<el-col :span="24">
<div class="grid-content bg-purple">
<el-form-item label="开始时间" prop="actionBeginTime">
<el-date-picker
v-model="form.actionBeginTime"
type="date"
placeholder="选择日期时间"
align="right"
clearable
></el-date-picker>
<el-button type="primary" @click="seachBtn">立即查询</el-button>
</el-form-item>
</div>
</el-col>