我们先看看通过接口回来的数据.
{
"message":"success",
"status":200,
"data":[
{
"id":2,
"rule_list":"{"title":[".item-text>h3","text"],"link":[".item-tit>a","href"]}",
"range_list":".item-phototext",
"author":"中华游戏网",
"name":"中华游戏网",
"handle":"chinaGame",
"url":"[https://game.china.com/news/jx/](https://game.china.com/news/jx/)",
"rule_content":"{"title":["h1","text"],"link":["#chan_newsDetail","html"]}",
"range_content":"",
"encoding":0,
"status":1,
"full_url":"",
"gather_types":1,
"defaultType":{
"id":1,
"name":"新闻"
}
}
]
}
其中,defaultType是需要回显的内容,即原选定的分类.
需要保证select下拉的ID和v-model里边的id保持一致
image.png