优化子节点判断

This commit is contained in:
lyswhut
2020-03-16 12:51:14 +08:00
parent b04c676288
commit c6551c9ea3
4 changed files with 3 additions and 13 deletions
+1 -1
View File
@@ -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: {
+1 -2
View File
@@ -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)