1.解决vue项目中import @/符号下有波浪线的问题
https://blog.csdn.net/weixin_48095370/article/details/115477678
1.首先打开webstorm中file->setting,之后找到language&frameworks中javascript的webpack选项
2.之后点开找到项目目录\node_modules\@vue\cli-service\webpack.config.js 后点应用即可。
1、根据子id 找出完整的父级数组
// 查找父元素
getParentNodes(id, tree) {
this._getParentNodes([], id, tree);
return this.nodes;
},
_getParentNodes(his, targetId, tree) {
tree.some((list) => {
const children = list.childVO || [];
if (list.id == targetId) {
his.push(list.id);
this.nodes = his;
return true;
} else if (children.length > 0) {
const history = [...his];
history.push(list.id);
return this._getParentNodes(history, targetId, children);
}
})
},
this.postOrGroupId1 = this.getParentNodes(this.form1.groupId,this.postList);
1、多个文件下载用window.open不行
https://blog.csdn.net/m0_37792830/article/details/103992796
单个文件下载
window.open(url)
多个文件下载
多个文件下载用window.open不行,你会发现他只下载了一个,并不是所有。
let triggerDelay = 100;
let removeDelay = 1000;
this.urlList.forEach((url, index) => {
this.createIFrame(url, index * triggerDelay, removeDelay);
});
// 这里是创建iframe的方法
function createIFrame(url, triggerDelay, removeDelay) {
//动态添加iframe,设置src,然后删除
setTimeout(function() {
var frame = document.createElement("iframe");
frame.src = url;
frame.style.display = "none";
document.body.appendChild(frame);
setTimeout(function() {
frame.remove();
}, removeDelay);
}, triggerDelay);
},
2、解决element-ui 中upload组件使用多个时无法绑定对应的元素
https://www.jianshu.com/p/6a4d0c6e26c2
3、vue项目添加Cropper.js实现裁剪功能
https://www.cnblogs.com/xingzoudecd/p/14028622.html