This commit is contained in:
parent
b631f64cbb
commit
3bbf8a51dc
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ag-element-ui",
|
"name": "ag-element-ui",
|
||||||
"version": "0.1.11",
|
"version": "0.1.12",
|
||||||
"main": "packages/index.js",
|
"main": "packages/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "vue-cli-service serve",
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
<ag-select
|
<ag-select
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
v-on="listeners"
|
v-on="listeners"
|
||||||
:value="values&&values[0]"
|
:options="$attrs.options||[]"
|
||||||
|
:value="value&&value[0]"
|
||||||
@change="onSelect"
|
@change="onSelect"
|
||||||
class="ag_select_group"
|
class="ag_select_group"
|
||||||
:style="{ width: `${swidth}px` }"
|
:style="{ width: `${swidth}px` }"
|
||||||
|
@ -105,12 +106,6 @@ export default {
|
||||||
return [null, ''];
|
return [null, ''];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: {
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
showExtra: {
|
showExtra: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
@ -137,7 +132,7 @@ export default {
|
||||||
throw new Error("请传入数组");
|
throw new Error("请传入数组");
|
||||||
}
|
}
|
||||||
let newselectValue=newVal[0];
|
let newselectValue=newVal[0];
|
||||||
const find=this.options.find((f)=>f.value==newselectValue);
|
const find=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;
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
<ag-select
|
<ag-select
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
v-on="listeners"
|
v-on="listeners"
|
||||||
:value="values&&values[0]"
|
:options="$attrs.options||[]"
|
||||||
|
:value="value&&value[0]"
|
||||||
@change="onSelect"
|
@change="onSelect"
|
||||||
class="ag_select_group"
|
class="ag_select_group"
|
||||||
:style="{ width: `${swidth}px` }"
|
:style="{ width: `${swidth}px` }"
|
||||||
|
@ -21,13 +22,13 @@
|
||||||
>
|
>
|
||||||
</ag-date-picker>
|
</ag-date-picker>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import agSelect from "../../agSelect/src/index.vue";
|
import agSelect from "../../agSelect/src/index.vue";
|
||||||
import agDatePicker from "../../agDatePicker/src/index.vue";
|
import agDatePicker from "../../agDatePicker/src/index.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "agMultionDattePicker",
|
name: "agMultionDattePicker",
|
||||||
components: {
|
components: {
|
||||||
agSelect,
|
agSelect,
|
||||||
|
@ -39,12 +40,6 @@
|
||||||
return [null, []];
|
return [null, []];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: {
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -67,7 +62,7 @@
|
||||||
throw new Error("请传入数组");
|
throw new Error("请传入数组");
|
||||||
}
|
}
|
||||||
let newselectValue=newVal[0];
|
let newselectValue=newVal[0];
|
||||||
const find=this.options.find((f)=>f.value==newselectValue);
|
const find=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;
|
||||||
|
@ -88,7 +83,6 @@
|
||||||
if(this.$listeners.change){
|
if(this.$listeners.change){
|
||||||
this.$emit("change", [value, this.value[1]||[]]);
|
this.$emit("change", [value, this.value[1]||[]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onInputChange(val){
|
onInputChange(val){
|
||||||
if(this.$listeners.change){
|
if(this.$listeners.change){
|
||||||
|
@ -140,32 +134,32 @@
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.popperOptions {
|
.popperOptions {
|
||||||
min-width: 200px !important;
|
min-width: 200px !important;
|
||||||
padding: 0px !important;
|
padding: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang='scss'>
|
<style scoped lang='scss'>
|
||||||
.ag-MultifunctionSearch {
|
.ag-MultifunctionSearch {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imeiicondefault {
|
.imeiicondefault {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background: #f0f2f5;
|
background: #f0f2f5;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.imeiiconActive {
|
.imeiiconActive {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
background: #e9f1fc;
|
background: #e9f1fc;
|
||||||
}
|
}
|
||||||
.divider {
|
.divider {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
@ -225,4 +219,4 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue