index.tsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Button, Popup } from 'vant';
  2. import { defineComponent, reactive } from 'vue';
  3. import styles from './index.module.less';
  4. export const tipState = reactive({
  5. show: false,
  6. title: '温馨提示',
  7. content: '退出后将清空批注内容',
  8. cancelText: '取消',
  9. confirmText: '确认退出'
  10. })
  11. export default defineComponent({
  12. name: 'tips-popup',
  13. emits: ['confirm'],
  14. setup(props, { emit }) {
  15. return () => (
  16. <Popup v-model:show={tipState.show} round class={styles.courseDialog}>
  17. <i
  18. class={styles.iconClose}
  19. onClick={() => (tipState.show = false)}></i>
  20. <div class={styles.title}>{tipState.title}</div>
  21. <div class={styles.content}>
  22. {tipState.content}
  23. </div>
  24. <div class={styles.popupBtnGroup}>
  25. <Button round onClick={() => tipState.show = false}>{tipState.cancelText}</Button>
  26. <Button round type="primary" onClick={() => emit("confirm")}>
  27. {tipState.confirmText}
  28. </Button>
  29. </div>
  30. </Popup>
  31. );
  32. }
  33. });