all files / src/table/ td.vue

0% Statements 0/10
0% Branches 0/6
100% Functions 0/0
0% Lines 0/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45                                                                                         
<template>
<td class="mu-td" @mouseenter="handleMouseEnter" @mouseleave="handleMouseLeave" @click="handleClick">
  <slot></slot>
</td>
</template>
 
<script>
export default {
  name: 'mu-td',
  props: {
    name: {
      type: String
    }
  },
  methods: {
    handleMouseEnter (event) {
      this.$emit('hover', event)
      if (this.$parent.handleCellHover) this.$parent.handleCellHover(event, this.name, this)
    },
    handleMouseLeave (event) {
      this.$emit('hoverExit', event)
      this.$emit('hover-exit', event)
      if (this.$parent.handleCellHoverExit) this.$parent.handleCellHoverExit(event, this.name, this)
    },
    handleClick (event) {
      this.$emit('click', event)
      if (this.$parent.handleCellClick) this.$parent.handleCellClick(event, this.name, this)
    }
  }
}
</script>
 
<style lang="less">
@import "../styles/import.less";
.mu-td{
  padding-left: 24px;
  padding-right: 24px;
  height: 48px;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
</style>