JFilePop - xinwu-yang/cube-vue GitHub Wiki

JFilePop 文件上传弹窗组件

Modal弹窗中的文件上传组件。显示弹窗需要通过$refs调用组件的show()方法。

/**
 * @param id string 唯一标识,可不传
 * @param filePath string 文件路径,可不传
 * @param fileType string 文件类型,值为'img' | 'file',默认'file',可不传
*/
show(id, filePath, fileType)

代码演示

<template>
	<j-file-pop ref="filePop" :number="3" @ok="handleFileSuccess" />
</template>
<script>
	export default {
    methods: {
      handleFileSuccess(file) {}
    },
    
    mounted() {
      this.$nextTick(() => {
        this.$refs.filePop.show()
      })
    }
  }
</script>

api

props

属性 说明 类型 必填 默认值
title 弹窗标题 string
width 弹窗宽度 number 520
disabled 是否禁用 boolean false
number 上传文件数量 number 0

事件

事件名称 说明 回调参数
ok 点击确定后调用 function(obj)
⚠️ **GitHub.com Fallback** ⚠️