【发布时间】:2021-11-12 18:47:04
【问题描述】:
有人知道如何使用 bootstrapVue 文件输入提交文件吗? 我从 request->all()
得到 nullarray:13 [
...
"calibration_cert" => array:1 [
"$path" => null
]
]
以下是我尝试过的
<b-form-group label="Calibration Cert:">
<b-form-file
v-model="form.calibration_cert"
:state="Boolean(form.calibration_cert)"
placeholder="Choose a file or drop it here..."
drop-placeholder="Drop file here..."
></b-form-file>
</b-form-group>
.....
methods:{
onSubmit(event) {
event.preventDefault();
axios
.post("/equipments/create", this.form, {
headers: {
"Content-Type": "multipart/form-data"
}
})
.then(response => {
console.log(response);
})
};
},
如果有人可以提供帮助,不胜感激
【问题讨论】:
标签: laravel vue.js vuejs2 axios bootstrap-vue