index.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <script setup>
  2. import Close from '../icons/Close.vue';
  3. import { ref } from 'vue';
  4. const props = defineProps({
  5. // 提示文字
  6. tips: {
  7. type: String,
  8. default: ''
  9. },
  10. // 是否显示
  11. visible: {
  12. type: Boolean,
  13. default: false,
  14. required: true
  15. }
  16. });
  17. const emits = defineEmits(['update:visible']);
  18. // 关闭
  19. const close = () => {
  20. emits('update:visible', false);
  21. };
  22. </script>
  23. <template>
  24. <div class="popup">
  25. <Close @click="close" class="icon" />
  26. <span>{{ tips }}</span>
  27. </div>
  28. </template>
  29. <style scoped>
  30. .popup {
  31. background-color: var(--sider-bg);
  32. border: 1px solid #241917;
  33. box-shadow: 0 5px 8px var(--button-normal-shadow);
  34. position: absolute;
  35. bottom: 0;
  36. right: 0;
  37. padding: 1.2vw 8vw;
  38. margin: 1.25vw;
  39. border-radius: 8px;
  40. }
  41. .icon {
  42. position: absolute;
  43. top: .4vw;
  44. right: .4vw;
  45. cursor: pointer;
  46. color: #241917;
  47. }
  48. .icon:hover {
  49. transform: rotate(180deg);
  50. transition: all 0.5s ease-out;
  51. }
  52. </style>