31
03/23
vue获取节点的父节点、兄弟节点、子节点
<span @click="getClickInfo(event)"> </span> getClickInfo: function (e) { let clickDom = e.currentTarget; // currentTarget 获取绑定点击事件的节点 let currentDom = e.target; // target 获取当前点击节点 let parent = clickDom.parentElement; // parentElement获取绑定事件节点的父节点 let previous = clickDom.previousElementSibling; // previousElementSibling获取绑定事件节点的前一个节点 let previousInner = previous.innerHTML; // 获取绑定...