Blame view

泰额版/Food Labeling Management Code/Yi.Vben5.Vue3/playground/src/views/examples/drawer/in-content-demo.vue 1.05 KB
383e20a3   杨鑫   拉取
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
  <script lang="ts" setup>
  import { ref } from 'vue';
  
  import { useVbenDrawer } from '@vben/common-ui';
  
  import { Input, message } from 'ant-design-vue';
  
  import { useVbenForm } from '#/adapter/form';
  
  const value = ref('');
  
  const [Form] = useVbenForm({
    schema: [
      {
        component: 'Input',
        componentProps: {
          placeholder: 'KeepAlive测试:内部组件',
        },
        fieldName: 'field1',
        hideLabel: true,
        label: '字段1',
      },
    ],
    showDefaultActions: false,
  });
  
  const [Drawer, drawerApi] = useVbenDrawer({
    destroyOnClose: false,
    onCancel() {
      drawerApi.close();
    },
    onConfirm() {
      message.info('onConfirm');
      // drawerApi.close();
    },
  });
  </script>
  <template>
    <Drawer append-to-main title="基础抽屉示例" title-tooltip="标题提示内容">
      <template #extra> extra </template>
      此弹窗指定在内容区域打开,并且在关闭之后弹窗内容不会被销毁
      <Input
        v-model:value="value"
        placeholder="KeepAlive测试:connectedComponent"
      />
      <Form />
    </Drawer>
  </template>