Value passing problem of vue and react

problem description

< H2 > vue background pass value < / H2 >

clipboard.png

vue

clipboard.png

react

clipboard.png

react

clipboard.png

-how sharp-sharp-sharp converts the form of react to the form of vue


react and vue encapsulate the js function used to initiate network requests into the same package


vue request seems to be encapsulated, ah, unified axios with qs encapsulation is fine.


install qs and axios packages first

yarn add qs axios

then set the request interceptor for axios

axios.interceptors.request.use((config)=>{
    if(config.method==='post'&&config.data){
        config.data=qs.stringify(config.data, { arrayFormat: 'repeat' })
    }
    return config
});

when this is set, when the request is post, the parameter is submitted as a form form


this is because your request method is inconsistent. This is not a react,vue problem.


you are using antd-pro . The content-type that encapsulates the fetch method is application/json . If you use the request body with data, change it to application/x-www-form-urlencoded estimate

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b228b0-2b62d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b228b0-2b62d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?