<template>
<div>
<el-radio-group v-model="type" size="small">
  <el-radio-button label="card">卡片模式</el-radio-button>
  <el-radio-button label="list">列表模式</el-radio-button>
</el-radio-group>

<el-checkbox v-model="disabled" style="margin-left: 24px;">禁用</el-checkbox>
<br/>
<br/>
<honjo-upload v-model="value" action="http://localhost:3000/nas/upload" :resp="resp" :type="type" :disabled="disabled" :limit="2" max-size="100K">
<div slot="tip">个数不超过3个， 大小不超过 100K</div>
</honjo-upload>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import { FileResp } from '@@/components/upload/HonjoUpload.vue'

/**
 * @title  限制
 * @desc 限制上传文件个数， 大小， 格式的限制。
 */
@Component
export default class LimitExample extends Vue {
  type = 'card'

  disabled = false

  value: FileResp[] = [
    {
      name: '1.jpg',
      url: 'http://localhost:3000/nas/download/1.jpg'
    }
  ]

  resp = (response: any) => response.data
}
</script>
