liunan #10

Merged
liunan merged 47 commits from liunan into master 2024-09-13 14:43:34 +08:00
1 changed files with 6 additions and 5 deletions
Showing only changes of commit 8565ddb5a3 - Show all commits

View File

@ -7,7 +7,7 @@
:value="value&&value[0]" :value="value&&value[0]"
@change="onSelect" @change="onSelect"
class="ag_select_group" class="ag_select_group"
:style="{ width: `${swidth}px` }" :style="{ width: `${swidth+20}px` }"
> >
</ag-select> </ag-select>
<ag-input <ag-input
@ -132,12 +132,13 @@
throw new Error("请传入数组"); throw new Error("请传入数组");
} }
let newselectValue=newVal[0]; let newselectValue=newVal[0];
const find=this.$attrs.options&&this.$attrs.options.find((f)=>f.value==newselectValue); const find=newselectValue&&newselectValue!=""&&this.$attrs.options&&this.$attrs.options.find((f)=>f.value==newselectValue);
if(find){ if(find){
let fontwidth=this.getStringWidth(find.label); let fontwidth=this.getStringWidth(find.label);
this.swidth=fontwidth>165?165:fontwidth; this.swidth=fontwidth>165?165:fontwidth;
}else{
this.swidth=120;
} }
}, },
immediate: true, immediate: true,
}, },
@ -151,7 +152,7 @@
methods: { methods: {
onSelect(value){ onSelect(value){
if(this.$listeners.change){ if(this.$listeners.change){
this.$emit("change", [value, this.value[1]||""]); this.$emit("change", [value||"", this.value[1]||""]);
} }
}, },