|
@@ -23,6 +23,7 @@
|
|
|
配置说明
|
|
|
config:{
|
|
|
attrs:{
|
|
|
+ valueType:'number',
|
|
|
filterable:true/false //搜索功能快速查找选项
|
|
|
itemLabel:'' //选项的标签
|
|
|
itemValue:'' //选项的值
|
|
@@ -83,8 +84,11 @@ export default class BySelect extends VueViews {
|
|
|
}
|
|
|
|
|
|
setValue(data:any){
|
|
|
- if(data){
|
|
|
+ if(data || data === 0){
|
|
|
this.value = (this as any).$lodash.cloneDeep(data);
|
|
|
+ if(this.attrs.valueType == 'number'){
|
|
|
+ this.value = String(this.value)
|
|
|
+ }
|
|
|
}else{
|
|
|
this.value = '';
|
|
|
}
|
|
@@ -103,7 +107,8 @@ export default class BySelect extends VueViews {
|
|
|
}
|
|
|
|
|
|
onChange(){
|
|
|
- this.$emit('onChange',this.value);
|
|
|
+ let v = this.attrs.valueType == 'number' ? Number(this.value) : this.value;
|
|
|
+ this.$emit('onChange',v);
|
|
|
}
|
|
|
|
|
|
// 清空数据
|