[Bug Report] 使用radio标签通过axios动态生成的option的值不重新渲染到页面上
- Vorherrschende Sprache
- Vue
- Sterne
- 17.5k
- Forks
- 3.6k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
### VUX version
2.9.1-rc.1
### OS/Browsers version
win10
### Vue version
2.5.17-beta.0
### Code
```html
import vue from 'vue'
import { Group,XHeader,Radio } from 'vux'
import axios from 'axios'
import getData from 'api/index'
// var url = 'http://101.201.145.200:9000/GetKeShi';
var url1 = 'http://wx.kwmzy.com/clinic/jibing'; // 通过科室ID获取一级疾病信息
var url2 = 'http://wx.kwmzy.com/clinic/subjibing'; // 通过一级疾病id获取二级疾病信息
export default {
components:{Group,XHeader,Radio},
data(){
return{
isActive:false,
activeIndex:'',
chooseills:[],
jibingIds:'',
nID:'',//从一级疾病获取的id ====> 用做参数来获取二级疾病
ills:[],
haveChild:true,
illsName:[]
}
},
methods:{
choosecondition(){
this.$router.push({name:'chooseCondition'})
},
change(value,label){ //保存点击的疾病的序号
// localStorage.setItem('nums',value);
console.log("value=" value 'label=' label);
localStorage.setItem('nums',value);
},
getills($event){
//$event的值等于传过来的疾病的编号
this.isActive = !(this.isActive);
let nID = $event;
let _this = this;
this.activeIndex = $event;
axios.get(url2 '?jibingid=' nID).then(function(res){
// console.log(res);
_this.ills = res.data.data.jibing;
// _this.ills = res.data.data.jibing;
// console.log(_this.ills);
let len = _this.ills.length;
for(let i = 0;i<len;i ){
let items = {
key:'',
value:''
}
items.value = _this.ills[i].sName;
items.key = _this.ills[i].sXuHao;
_this.illsName.push(items);
//这里要构造key = sname value = 下一个页面的参数
}
console.log(_this.illsName);
console.log('------------');
console.log(_this.ills);
})
}
},
created(){
let _this = this;
let ids = localStorage.getItem("key");
console.log(ids);
// debugger;
axios.get(url1 '?keshiid=' ids).then(function(res){
let cill = res.data.data.jibing;
_this.chooseills = cill;
//console.log(res);
//console.log(_this.chooseills);
let len = cill.length;
let hc = _this.haveChild;
for(let i = 0;i<len;i ){
if(cill[i].nHaveChild == 0){
_this.haveChild = false;
}else if(cill[i].nHaveChild == 1){
_this.haveChild = true;
}
//cill[i].nHaveChild == 0 ? hc = true : hc = false;
}
console.log("hc=" hc);
console.log('-------------')
console.log(cill);
})
}
}
```
### Steps to reproduce
点击上一级的li选项会重新获取radio里面options值,而页面上不会重新渲染新值
### What is Expected?
页面randio里面的value值会变化
### What is actually happening?
页面randio里面的value值无变化
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.