You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

60 lines
1.2 KiB

<template>
<div class="tw-flex tw-flex-col">
<select :class="['tw-pr-[40px]', validation ? '' : 'tw-border-error-default']" v-model="value" @change="inputVal">
<option :value="0">{{ $t("Select option") }}</option>
<option v-for="(name, index) in yearList" :key="index">
{{ name }}
</option>
</select>
</div>
</template>
<script>
export default {
name: "ElementSelect",
props: {
select: {
type: Object,
},
yearList: {
type: Array,
},
default: {
type: String,
},
validation: {
type: Boolean,
},
},
data() {
return {
value: this.default ?? null,
};
},
mounted() { },
watch: {
default: {
handler: function () {
this.value = this.default;
},
},
},
methods: {
inputVal() {
this.$emit("change", this.value);
},
},
};
</script>
<style lang="scss" scoped>
select {
-moz-appearance: none;
/* Firefox */
-webkit-appearance: none;
/* Safari and Chrome */
appearance: none;
background-image: url("~/assets/svg/down-arrow.svg");
background-size: 9px 6px;
background-position: right 20px center;
background-repeat: no-repeat;
}
</style>