tool.tsx 924 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // import { Grid, GridItem } from 'vant';
  2. import { defineComponent } from 'vue';
  3. import styles from './tool.module.less';
  4. import iconPen from '../image/icon-pen.png';
  5. export type ToolType = 'init' | 'pen';
  6. export type ToolItem = {
  7. type: ToolType;
  8. name: string;
  9. icon: string;
  10. };
  11. export default defineComponent({
  12. name: 'tool',
  13. emits: ['handleTool'],
  14. setup(props, { emit }) {
  15. const tool: ToolItem[] = [
  16. {
  17. type: 'pen',
  18. icon: iconPen,
  19. name: '批注'
  20. }
  21. ];
  22. return () => (
  23. <div class={styles.tool}>
  24. <div class={styles.title}>教学功能</div>
  25. {/* <Grid class={styles.grid} columnNum={3} border={false}>
  26. {tool.map(item => (
  27. <GridItem
  28. icon={item.icon}
  29. text={item.name}
  30. onClick={() => emit('handleTool', item)}></GridItem>
  31. ))}
  32. </Grid> */}
  33. </div>
  34. );
  35. }
  36. });