树控件自动定位到默认选中的位置bug

master
e 3 years ago
parent 175e1c9b12
commit ca6d83c85a
  1. 1
      src/components/myTree/src/tree.vue
  2. 12
      src/views/Transaction.vue

@ -486,7 +486,6 @@
}, },
mounted() { mounted() {
console.log(this.data)
this.initTabIndex(); this.initTabIndex();
this.$el.addEventListener('keydown', this.handleKeydown); this.$el.addEventListener('keydown', this.handleKeydown);
}, },

@ -479,18 +479,14 @@ export default {
}); });
}, },
handleCheckChange(data, checked, indeterminate, row, index) { // handleCheckChange(data, checked, indeterminate, row, index) { //
console.log('=================')
let divTree = '#divTree'+index; let divTree = '#divTree'+index;
let dom = document.querySelector(divTree) let dom = document.querySelector(divTree)
let depTree = '#depTree'+index; let depTree = '#depTree'+index;
let dom1 = document.querySelector(depTree) let dom1 = document.querySelector(depTree)
let nodeHight =20 let nodeHight =26
dom1.style.height = (data.number * nodeHight) + "px" dom1.style.height = (data.number * nodeHight) + "px"
let contHeight=(data.number * nodeHight)//, let contHeight=(data.number * nodeHight)//,
console.log(contHeight)
dom.scrollTo(0, contHeight) dom.scrollTo(0, contHeight)
console.log(data)
console.log('=================')
this.checkChange = true this.checkChange = true
if (checked && data.isNode === 1) { if (checked && data.isNode === 1) {
this.tableData[index].operationIds = data.id; // id this.tableData[index].operationIds = data.id; // id
@ -808,7 +804,11 @@ export default {
} }
}; };
</script> </script>
<style>
.el-tree-node__content {
height: 26Px!important;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
position: relative; position: relative;

Loading…
Cancel
Save