hide.vue 727 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <i
  3. v-if="innerValue"
  4. class="el-icon-circle-close pl-1"
  5. style="cursor: pointer; font-weight: 600; transition: 500ms"
  6. @click="onHide"
  7. ></i>
  8. </template>
  9. <script>
  10. export default {
  11. name: "IconHide",
  12. components: {},
  13. props: {
  14. value: {
  15. type: Boolean,
  16. require: true,
  17. },
  18. },
  19. data() {
  20. return {};
  21. },
  22. computed: {
  23. innerValue: {
  24. get() {
  25. return this.$props.value;
  26. },
  27. set(value) {
  28. this.$emit("input", value);
  29. },
  30. },
  31. },
  32. watch: {},
  33. methods: {
  34. onHide() {
  35. this.innerValue = !this.innerValue;
  36. this.$emit("hide");
  37. },
  38. },
  39. created() {},
  40. mounted() {},
  41. destroyed() {},
  42. };
  43. </script>
  44. <style scoped></style>