ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
<script lang="ts" setup>
import { reactive, toRefs } from 'vue';
 
import { ScrollContainer } from '@jnpf/ui';
 
defineOptions({ name: 'ExtendFormDemoFieldForm3' });
 
interface State {
  fileList: any[];
  imgList: any[];
}
 
const state = reactive<State>({
  fileList: [
    {
      name: 'food.jpeg',
      url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
    },
    {
      name: 'food2.jpeg',
      url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
    },
  ],
  imgList: [],
});
const { fileList, imgList } = toRefs(state);
</script>
<template>
  <div class="jnpf-content-wrapper jnpf-content-wrapper-form">
    <div class="jnpf-content-wrapper-form-body px-[10px]">
      <ScrollContainer>
        <div class="my-[10px]">
          <a-alert message="单附件上传、图片上传组件" type="warning" :show-icon="false" />
        </div>
        <a-form :colon="false" :label-col="{ style: { width: '110px' } }">
          <a-form-item label="上传附件">
            <jnpf-upload-file v-model:value="fileList" show-tip :show-view="false" :show-download="false" />
          </a-form-item>
          <a-form-item label="图片上传">
            <jnpf-upload-img v-model:value="imgList" />
          </a-form-item>
        </a-form>
      </ScrollContainer>
    </div>
  </div>
</template>