useCell.ts 346 B

12345678910111213
  1. import { computed } from 'vue'
  2. import { useParent } from './useParent'
  3. import { CELL_GROUP_KEY } from '../wd-cell-group/types'
  4. export function useCell() {
  5. const { parent: cellGroup, index } = useParent(CELL_GROUP_KEY)
  6. const border = computed(() => {
  7. return cellGroup && cellGroup.props.border && index.value
  8. })
  9. return { border }
  10. }