index.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. const close = () => {
  19. emits('update:visible', false);
  20. };
  21. </script>
  22. <template>
  23. <div class="popup">
  24. <Close @click="close" class="icon" />
  25. <span>{{ tips }}</span>
  26. </div>
  27. </template>
  28. <style scoped>
  29. .popup {
  30. background-color: var(--sider-bg);
  31. border: 1px solid #241917;
  32. box-shadow: 0 5px 8px var(--button-normal-shadow);
  33. position: absolute;
  34. bottom: 0;
  35. right: 0;
  36. padding: 1.2vw 8vw;
  37. margin: 1.25vw;
  38. border-radius: 8px;
  39. }
  40. .icon {
  41. position: absolute;
  42. top: .4vw;
  43. right: .4vw;
  44. cursor: pointer;
  45. color: #241917;
  46. }
  47. .icon:hover {
  48. transform: rotate(180deg);
  49. transition: all 0.5s ease-out;
  50. }
  51. </style>