<template>
  <span>
    <template v-if="!isCompare || oldVal == newVal">
      <span>
        <slot></slot>
      </span>
    </template>
    <span v-else class="tipsOldVal">
      <el-popover placement="top-start" width="200" trigger="hover">
        <div class="f12">
          {{ $t1('变更前') }}：{{ oldLabel }}
        </div>
        <div slot="reference" :class="{ icon: oldVal != newVal }"><i class="el-icon-warning" @click.stop></i></div>
      </el-popover>
      <slot></slot>
    </span>
  </span>
</template>

<script>
export default {
  name: "compareView",
  props: ['isCompare', 'oldVal', 'oldLabel', 'newVal']
}
</script>

<style scoped></style>
