(component): update

This commit is contained in:
就眠儀式 2022-08-03 00:18:37 +08:00
parent 97f2231ca9
commit 4e6a77ee19
2 changed files with 16 additions and 11 deletions

View File

@ -280,7 +280,10 @@ const getFixedColumn = () => {
hasr.value = true;
} else {
// @ts-ignore
if (tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2 > tableBody.value?.scrollWidth) {
if (
tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2 >
tableBody.value?.scrollWidth
) {
hasl.value = true;
hasr.value = false;
} else {

View File

@ -75,8 +75,8 @@ const className = computed(() => {
let tree = ref();
let nodeList = ref();
const unWatch=ref(false);
const initStatus=ref(false);
const unWatch = ref(false);
const initStatus = ref(false);
const loadNodeList = () => {
let { tree: _tree, nodeList: _nodeList } = useTree(props, emit);
tree.value = _tree;
@ -92,13 +92,14 @@ watch(
watch(
() => props.checkedKeys,
() => {
if(!unWatch.value){
if (!unWatch.value) {
loadNodeList();
}
}
);
watch(
tree, () => {
tree,
() => {
if (initStatus.value) {
const { checkedKeys } = tree.value.getKeys();
unWatch.value = true;
@ -107,14 +108,15 @@ watch(
unWatch.value = false;
}, 0);
}
}, { deep: true }
},
{ deep: true }
);
onMounted(()=>{
nextTick(()=>{
initStatus.value=true;
})
})
onMounted(() => {
nextTick(() => {
initStatus.value = true;
});
});
function handleClick(node: TreeData) {
const originNode = tree.value.getOriginData(node.id);