1. Upload the array bound by multiple pictures: shopimg: [] and send it to the background. The background needs string. Comma segmentation will report an error
when using join (“-“), it will report an error. Change it to tostring() method
code:
this.personalForm.shopImg = this.personalForm.shopImg.toString();//Store photo-array to string, join will report an error, toString default comma split
2. Time array, businesstime: [“17:03”, “18:03”]
the string format of “17:03-18:03” is required in the background, and an error is reported in the join segmentation; (if you find that the store has the same business hours, you will be prompted that there are the same business hours. Then you will change the business hours and click the submit button again, and you will go through the segmentation twice. At this time, the businesstime is no longer an array, and the join method is not found – an error is reported)
if(this.personalForm.businessTime.length == 2){//After printing the error, go through the split twice and judge the length == 2 before splitting
// console.log(this.personalForm.businessTime,'this.personalForm.businessTime time ===========');
this.personalForm.businessTime = this.personalForm.businessTime.join("-");// business time, background to "17:03-18:03" this form
}
Read More:
- How to Solve JS error: Unexpected end of JSON input,Unexpected token u in JSON at position 0
- @requestbody: How to Use or Not Use
- [Solved] PDF.js Error: Cannot use the same canvas during multiple render()
- js: SyntaxError: Cannot use import statement outside a module
- How to use HPQC on Chrome browser
- How to Use DOM to operate CSS
- How to use Runtime.getRuntime().Exec()
- Solution to some map files in JS folder after Vue packaging (remove the map. JS file)
- Javascript: How to Use Date.Now() to implement front-end frequency limit
- Vue2.0: How to Use vue3 api to encapsulate Axios
- [Vue warn]: Error in callback for watcher “value“ (How to Solve)
- Json.parse: All Error & How to Solve Them
- Solution to build error in Vue project (error in static/JS)/vendor.xxxxx.js from UglifyJs)
- Use of $watch in Vue (solve rangeerror: maximum call stack size exceeded)
- [Solved] Nuxt Import qrcodejs2.js / QRCode.js Error: document is not defined
- How to Solve “Vue is not defined” Error
- How to Solve pinia Error in ts File
- JS to find the last character of the string and remove it
- How to Solve VUE Error: Avoid mutating a prop directly since the value will be overwritten …
- JS to determine whether the string contains a character