gaoluyang
2026-06-24 c0cb161bb52ce0fbdce5c66ec391d107c75e2452
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<script lang="ts" setup>
import { ref } from 'vue';
 
import { Tinyflow } from '@tinyflow-ai/vue';
 
import '@tinyflow-ai/vue/dist/index.css';
 
defineProps<{
  data: any;
  provider: any;
}>();
 
const tinyflowRef = ref<InstanceType<typeof Tinyflow> | null>(null);
 
defineExpose({
  getData: () => tinyflowRef.value?.getData(),
});
</script>
<template>
  <Tinyflow
    ref="tinyflowRef"
    class-name="custom-class"
    :data="data"
    :provider="provider"
  />
</template>
<style scoped>
:deep(.custom-tinyflow) {
  select {
    appearance: auto !important;
  }
 
  /* 如果使用checkbox需要添加 */
  input[type='checkbox'] {
    width: 16px;
    height: 16px;
    margin: 0 4px;
    border: 1px solid #ccc;
  }
}
 
input[type='checkbox'] {
  position: relative;
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  cursor: pointer;
  border: 2px solid #d9d9d9;
  border-radius: 4px;
  transition: all 0.3s;
 
  &:checked {
    background-color: #1890ff;
    border-color: #1890ff;
 
    &::after {
      position: absolute;
      top: 50%;
      left: 50%;
      width: 8px;
      height: 12px;
      content: '';
      border: 2px solid #fff;
      border-top: 0;
      border-left: 0;
      transform: translate(-50%, -60%) rotate(45deg);
    }
  }
 
  &:hover {
    border-color: #40a9ff;
  }
}
</style>