np-form File Upload

By setting type: 'upload', the file upload component can be used in the form, which is internally built on np-upload.

The v-model value is of type string[], where each item is a JSON string of {name, url, type} by default. When listType is image-card and urlOnly is true, each item only stores the file's url string.

浏览器不支持,请手动复制 upload.en.vue

Component Configuration

FormColumn Props

PropDescriptionTypeDefault
typeSet to 'upload'string-
propsNUpload props, passed through to n-uploadNUpload Propsopen in new window-
urlOnlyOnly effective when listType: 'image-card', value is simplified to an array of url stringsbooleanfalse
defaultValueDefault file liststring[]-
onChangeFile list change event(value: string[], ctx) => void-