今天在学习这以章节的时候,由于是白嫖用户。。所有呢~ 康师傅的视频资料是没有的,资料没有但是写还是要写的,毕竟跟着这个都快写完了,于是乎就掏出自己辣鸡的JS,尝试对MD插件中的工具栏图标进行类康师傅修改效果。
let that = this;
document.getElementsByClassName('op-image popup-dropdown transition')[0].innerHTML = null; //将鼠标移入是出现的Div直接删除
document.getElementsByClassName('op-icon fa fa-mavon-picture-o dropdown dropdown-wrapper')[0].onclick = function () {
that.showInsertSelector();
};
showImageSelector() {
this.selectedImgForm = 'cover';
this.isImageSelectorShow = true;
console.log(this.selectedImgForm);
},
showInsertSelector() {
this.selectedImgForm = 'article';
this.isImageSelectorShow = true;
console.log(this.selectedImgForm);
},
关键代码就是这里了,效果实现是和康师傅视频中的一样,目前其他问题还没有发现。