提交 c9cd5686 编写于 作者: Neuromancer255's avatar Neuromancer255

数据选择(下拉视图)调整 --fix1

上级 94a61565
...@@ -169,14 +169,6 @@ export default class AppSelectDropDown extends Vue { ...@@ -169,14 +169,6 @@ export default class AppSelectDropDown extends Vue {
*/ */
@Prop({ default: {} }) protected navigateContext?: any; @Prop({ default: {} }) protected navigateContext?: any;
/**
* 当前值
*
* @type {string}
* @memberof AppSelectDropDown
*/
public curvalue: string = '';
/** /**
* 下拉数组 * 下拉数组
* @type {any[]} * @type {any[]}
...@@ -221,16 +213,16 @@ export default class AppSelectDropDown extends Vue { ...@@ -221,16 +213,16 @@ export default class AppSelectDropDown extends Vue {
* @readonly * @readonly
* @memberof AppSelectDropDown * @memberof AppSelectDropDown
*/ */
get refvalue() { get curvalue() {
if (this.valueitem && this.data && this.items.length > 0) { if(this.value && this.items.length > 0){
let index = this.items.indexOf(this.data[this.valueitem]) let isIncluded = this.items.some((item:any)=>{return item.name === this.value})
if(index !== -1){ if (isIncluded) {
return this.data[this.valueitem]; return this.value;
} else { } else {
return this.curvalue; return "";
} }
} }
return this.curvalue; return "";
} }
/** /**
...@@ -239,7 +231,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -239,7 +231,7 @@ export default class AppSelectDropDown extends Vue {
* @readonly * @readonly
* @memberof AppSelectDropDown * @memberof AppSelectDropDown
*/ */
set refvalue(item: any) { set curvalue(item: any) {
this.onSelect(item); this.onSelect(item);
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册