GithubHelp home page GithubHelp logo

Comments (2)

lucky-wwww avatar lucky-wwww commented on June 14, 2024

在parser中对上传组件添加before-upload进行数量限制

from form-generator.

txl945 avatar txl945 commented on June 14, 2024

在parser中对上传组件添加before-upload进行数量限制
你好,请问我在render中注入了before-upload函数
if (this.conf.config.tag === 'el-upload') {
// 上传表单元素组件 的成功和移除事件;
dataObject.attrs['on-success'] = (response, file, fileList) => {
this.$emit('upload', response, file, fileList)
}
dataObject.attrs['on-remove'] = (file, fileList) => {
this.$emit('deleteUpload', file, fileList)
}
dataObject.attrs['on-preview'] = (file) => {
this.$emit('download', file)
}
dataObject.attrs['before-upload']=(file) =>{
this.$emit('beforeUpload',file)
}
return
}
Parser中也加入到了listener,但是没有触发是怎么回事呀
function buildListeners(scheme) {

const config = scheme.config
const methods = this.formConf.methods || {}
const listeners = {}

// 给__methods__中的方法绑定this和event
Object.keys(methods).forEach(key => {
listeners[key] = event => methods[key].call(this, event)
})
// 响应 render.js 中的 vModel $emit('input', val)
listeners.input = event => setValue.call(this, event, config, scheme)
listeners.upload = (response, file, fileList) => setUpload.call(this, config, scheme,response, file, fileList)
listeners.deleteUpload = (file, fileList) => deleteUpload.call(this, config, scheme,file, fileList)
listeners.download = (file) => download.call(this, file)
listeners.beforeUpload=(file) =>beforeUpload.call(this,file,scheme)
return listeners
}

from form-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.