<select id="year" onchange="changyear()" >
</select> 年
<select id="month" onchange="changemonth()">
</select> 月
<select id="day">
</select> 日
//通过 document.createElement("option") 创建option
var option = document.createElement("option");
option .text = “值”;
option .value = “值”;
select的名字.add(option); //将创建好的option添加进select中
select的名字.value 设置默认显示的值(option有的值才行)
document.getElementById("select") .remove(option的下标) ; //删除一个选项
// 通过 年 和 月份 获取当月的总天数
var date = new Date(year,month,0).getDate();
elementUI Table获取单击的是第几行和第几列
html:
<el-table :cell-class-name="tableCellClassName" @cell-click="cellClick">
</el-table>
js:
methods:{
tableCellClassName({row, column, rowIndex, columnIndex}){
//注意这里是解构
//利用单元格的 className 的回调方法,给行列索引赋值
row.index=rowIndex;
column.index=columnIndex;
},
cellClick(row, column, cell, event){
console.log(row.index);
console.log(column.index);
}
}
el-upload 自定义事件传参
<el-upload
class="upload-demo"
list-type="picture"
accept="image/*"
:show-file-list="false"
:multiple="false"
:auto-upload="false"
action="https://jsonplaceholder.typicode.com/posts/"
**:on-change="(file, fileList) => {你的方法名(file, fileList, 自定义参数1,自定义参数2...)}"**
:on-preview="handlePreview">
<a size="small" type="primary">点击修改</a>
</el-upload>