当前位置:网站首页>[background interaction] select to bind the data transferred in the background

[background interaction] select to bind the data transferred in the background

2022-06-11 12:56:00 It's Yanyan (whose vest)

html
<Select
                                    v-model="adddata.designee"
                                    multiple
                                    clearable
                                    filter
                                    class="searchSelect"
                                >
                                    <Option
                                        v-for="item in userList"// data 
                                        :value="item.id"
                                        :key="item.id"
                                        >{
    {
    item.sectiontitle}}-{
    {
     item.name }}{
    {
    (work_code)}}</Option
                                    >
                                </Select>
//js
data(){
    
 return{
    
   userLilst:[]// data 
 }
}
created(){
    
  this.getUserByUid()
}
getUserByUid() {
    
            //  Acquisition personnel 
            this.request(
                "/config/ProjectUser/GetUserLists",// Interface  ProjectUser/GetUserLists
                "",
                "get"
            ).then((res) => {
    
                if (res.data.ret == 1) {
    
                    this.userList = res.data.data;
                    console.log(JSON.stringify(this.userList));
                }
            });
        },

There is no data in the drop-down box —— Consider interfaces
Log in to your account again , Click the page to be changed F12
 Insert picture description here

The interface is written incorrectly F12,404 The interface parent is written incorrectly

 this.request(
                "/config/ProjectUser/GetUserLists"// Correct port 
原网站

版权声明
本文为[It's Yanyan (whose vest)]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111227042528.html