淘宝做任务网站,南昌网站建设资讯,wordpress 百科 插件,刘淼 网站开发搜索export default {data() {return {input: ,//用来接受input框的值name:,// 用来存储foreach的对应的值id:,// 用来存储foreach的对应的值dq:// 用来存储foreach的对应的值}},methods:{submit(){console.log(this.input);// 打印let str this.input;// 声明变量接受input的…搜索export default {data() {return {input: ,//用来接受input框的值name:,// 用来存储foreach的对应的值id:,// 用来存储foreach的对应的值dq:// 用来存储foreach的对应的值}},methods:{submit(){console.log(this.input);// 打印let str this.input;// 声明变量接受input的值let strArr str.split(,);// 用来分隔str值 如 {1,2,3} 分隔后 {1},{2},{3}console.log(strArr);for(let i 0;ithis.name strArr[0];// name 接受第一个位置的值this.id strArr[1];// id 接受第二个位置的值this.dq strArr[2];// dq 接受第三个位置的值var url this.$global.serverPath /pulicApi/addInfo?namethis.nameidthis.iddqthis.dqconsole.log(this.namethis.idthis.dq);// 打印}}}}就是类似上图这种的搜索,就是一个搜索框输入多字段的值,点击搜索时向后台提交的时候。一个值对应一个字段例如name张三id0314这种的。但是现在有一个问题就是如果说搜索框的值按照正常的输入内容,是没有问题的。name,id,dq依次输入。这种方式是可以接受到值,要是顺序乱了,id,name,dq按照这种的方式输入的话。后台接受到的值就乱了求各位给个思路。