element知识

element时间选择器   
el-date-picker标签添加
value-format=”yyyy-MM-dd”属性,
会让 Fri Sep 07 2018 00:00:00 GMT+0800 (中国标准时间) 的值变成yyyy-mm-dd的格式
--------------------------
前端导出Excel
  this.axios({
method:'post',
url:this.$Api.keyProjects.exportNoGreenCharts2,-------接口地址
responseType:'blob',-----类型 不写的话会乱码
}).then(res=>{
let objectUrl = window.URL.createObjectURL(new Blob([res]));
const elink = document.createElement('a');
elink.download = `非绿化建筑统计.xlsx`; //下载文件名称,
elink.style.display = 'none';
elink.href = objectUrl;
document.body.appendChild(elink);
elink.click();
document.body.removeChild(elink);
window.URL.revokeObjectURL(elink.href); // 释放URL 对象
})
------------------
父元素display:flex,要让其中一个子元素水平居右 子元素style:margin-left:auto;
-------------------
‘20221209’时间字符串转换为‘2022-12-09’的格式;
timeStr = str.slice(0,4) + '-' str.slice(4,6) + '-' + str.slice(6) timeStr = '2022-12-09' str = '20221209'

posted on 2022-12-07 16:59  kaookiee  阅读(27)  评论(0)    收藏  举报