由element-ui从1到2升级出现的问题

1.el-picker日期格式的问题

    <el-date-picker type="year" v-model="editForm.termyear"   @change="editChangeYear" value-format="yyyy"></el-date-picker>

以前写的是format。。现在改成这个value-format

change事件直接获取的就是你设置的格式化的时间格式

addChangeYear(val){
                this.addForm.termyear=val;//年份格式化
            },

value-format可选的值有,

年份  value-format="yyyy"

年月日value-format="yyyy-MM-dd"

年月日时分秒value-format="yyyy-MM-dd HH:mm:ss"

原来你一旦改变改变select的id值他就会触发他的change事件,但是现在你必须自己手动的去写函数才会触发。

弹窗的批量删除样式问题。他会在dialog样式的外面。只需要你在批量删除的那个el-col外面再加一层el-row就可以啦

<!--工具条-->
        <el-row>
        <el-col :span="24" class="toolbar">
            <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button>
            <el-pagination layout="prev, pager, next" @current-change="handleCurrentChangeUser" :page-size="10" :total="totalUser" style="float:right;">
            </el-pagination>
        </el-col>
        </el-row>

弹窗样式问题。弹窗的宽度是50%。以前在样式里面设置好了。这里你需要在html里面自己手动添加。

<el-dialog title="新增" v-model="addFormVisible" :visible.sync="addFormVisible" width="50%">  

设置大小的 size 没了,换成了 width 长度。

visible.sync是否显示弹窗

 v-model是否需要遮罩层 他和是否显示弹窗是同步一样的。写一个参数就可以啦。

猜你喜欢

转载自blog.csdn.net/qq_33769914/article/details/81875809