<el-date-picker
v-model="dataPicker"
align="right"
type="date"
placeholder="选择日期"
size="small"
/>
<!-- script -->
data () {
return : {
// ...
dataPicker:new Date
}
}
时间转换
```javascript
date(date) {
date = new Date(date);
var y = date.getFullYear();
var m = date.getMonth() + 1;
var d = date.getDate();
m = m < 10 ? "0" + m : m;
d = d < 10 ? "0" + d : d;
return y + "-" + m + "-" + d;
},
element-UI输入框时间默认今天
最新推荐文章于 2024-01-11 11:02:44 发布