<template>
    <div :class="eyeClass" style="display: inline-block;position: absolute;right: 0px;cursor:pointer;height: auto;width: 36px;text-align: center;" @click="onClick"></div>
</template>

<script>
export default {
  name: "PlEyeImage",
  props: {
    onEyeChange: {type: Function},
    field: {type: String,default: ''},
  },
  data() {
    return {
      isShow: true,
      eyeClass: 'saspiconfont pl-icon-Group-'
    }
  },
  methods: {
    onClick() {
      this.isShow = !this.isShow;
      if (!this.isShow) {
        this.eyeClass = "saspiconfont pl-icon-icon-test";
      } else {
        this.eyeClass = "saspiconfont  pl-icon-Group-";
      }
      this.onEyeChange && this.onEyeChange(this.field);
    }
  }
}
</script>

<style scoped>

</style>
