Compare commits
2 Commits
578004cdb7
...
57ef27b43d
Author | SHA1 | Date |
---|---|---|
ln1778 | 57ef27b43d | |
ln1778 | 8565ddb5a3 |
|
@ -44,7 +44,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
values: [null, []],
|
||||
swidth:90,
|
||||
swidth:100,
|
||||
inputValue:"",
|
||||
selectvalue:"",
|
||||
imeipopover:false,
|
||||
|
@ -66,6 +66,8 @@ export default {
|
|||
if(find){
|
||||
let fontwidth=this.getStringWidth(find.label);
|
||||
this.swidth=fontwidth>165?165:fontwidth;
|
||||
}else{
|
||||
this.swidth=100;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
:value="value&&value[0]"
|
||||
@change="onSelect"
|
||||
class="ag_select_group"
|
||||
:style="{ width: `${swidth}px` }"
|
||||
:style="{ width: `${swidth+20}px` }"
|
||||
>
|
||||
</ag-select>
|
||||
<ag-input
|
||||
|
@ -132,12 +132,13 @@
|
|||
throw new Error("请传入数组");
|
||||
}
|
||||
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){
|
||||
let fontwidth=this.getStringWidth(find.label);
|
||||
this.swidth=fontwidth>165?165:fontwidth;
|
||||
}else{
|
||||
this.swidth=120;
|
||||
}
|
||||
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
|
@ -151,7 +152,7 @@
|
|||
methods: {
|
||||
onSelect(value){
|
||||
if(this.$listeners.change){
|
||||
this.$emit("change", [value, this.value[1]||""]);
|
||||
this.$emit("change", [value||"", this.value[1]||""]);
|
||||
}
|
||||
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue