优化子节点判断
parent
b04c676288
commit
c6551c9ea3
|
@ -6,7 +6,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
// import { isChildren } from '../../utils'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
list: {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
// import { isChildren } from '../../utils'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
list: {
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { isChildren } from '../../utils'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
props: {
|
||||
|
@ -48,7 +47,7 @@ export default {
|
|||
methods: {
|
||||
handleHide(e) {
|
||||
// if (e && e.target.parentNode != this.$refs.dom_list && this.show) return this.show = false
|
||||
if (e && (e.target == this.$refs.dom_btn || isChildren(this.$refs.dom_btn, e.target))) return
|
||||
if (e && (e.target == this.$refs.dom_btn || this.$refs.dom_btn.contains(e.target))) return
|
||||
setTimeout(() => {
|
||||
this.show = false
|
||||
}, 50)
|
||||
|
|
|
@ -163,15 +163,6 @@ export const objectDeepMerge = (target, source) => {
|
|||
Object.assign(target, base)
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否父子元素
|
||||
* @param {*} parent
|
||||
* @param {*} children
|
||||
*/
|
||||
export const isChildren = (parent, children) => {
|
||||
return children.parentNode ? children.parentNode === parent ? true : isChildren(parent, children.parentNode) : false
|
||||
}
|
||||
|
||||
/**
|
||||
* 升级设置
|
||||
* @param {*} setting
|
||||
|
|
Loading…
Reference in New Issue