You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
<template>
|
|
<div :class="[
|
|
{
|
|
'ps-tree-drag-up':
|
|
dataSourceKey != data.key &&
|
|
dataSourceKey != undefined &&
|
|
!isChildOf(data.key, dataSourceKey, list) &&
|
|
status === ENiuTreeStatus.DragUp,
|
|
'ps-tree-drag-in':
|
|
dataSourceKey != data.key &&
|
|
dataSourceKey &&
|
|
!isChildOf(data.key, dataSourceKey, list) &&
|
|
status === ENiuTreeStatus.DragIn,
|
|
'ps-tree-drag-down':
|
|
dataSourceKey != data.key &&
|
|
dataSourceKey &&
|
|
!isChildOf(data.key, dataSourceKey, list) &&
|
|
status === ENiuTreeStatus.DragDown,
|
|
},
|
|
]"></div>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import { isChildOf } from "./util";
|
|
import { ENiuTreeStatus, INiuTreeData, INiuTreeKey } from "./type";
|
|
const props = withDefaults(
|
|
defineProps<{
|
|
data: INiuTreeData
|
|
list: INiuTreeData[]
|
|
dataSourceKey?: INiuTreeKey
|
|
status?: ENiuTreeStatus
|
|
}>(),
|
|
{},
|
|
)
|
|
</script>
|
|
|