feat: refs #7527 improve star icon in edit
This commit is contained in:
parent
9d5ef13bd6
commit
2486ddef36
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
@ -7,7 +7,6 @@ import FetchData from 'components/FetchData.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import CustomerAddressForm from '../components/CustomerAddressForm.vue';
|
import CustomerAddressForm from '../components/CustomerAddressForm.vue';
|
||||||
import CustomerAddressEdit from '../components/CustomerAddressEdit.vue';
|
import CustomerAddressEdit from '../components/CustomerAddressEdit.vue';
|
||||||
import { onMounted } from 'vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -81,7 +80,8 @@ const getClientData = async (id) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const isDefaultAddress = (address) => {
|
const isDefaultAddress = (address) => {
|
||||||
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
|
address.isDefaultAddress = client?.value?.defaultAddressFk === address.id ? 1 : 0;
|
||||||
|
return address.isDefaultAddress;
|
||||||
};
|
};
|
||||||
|
|
||||||
const setDefault = (address) => {
|
const setDefault = (address) => {
|
||||||
|
|
|
@ -70,10 +70,8 @@ function handleLocation(data, location) {
|
||||||
unchecked-icon="star"
|
unchecked-icon="star"
|
||||||
indeterminate-icon="star"
|
indeterminate-icon="star"
|
||||||
size="lg"
|
size="lg"
|
||||||
:style="{
|
|
||||||
'font-variation-settings': `'FILL' ${data.isDefaultAddress ? 1 : 0}`,
|
|
||||||
}"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
|
:class="{ 'fill-icon': !!data.isDefaultAddress }"
|
||||||
/>
|
/>
|
||||||
<QCheckbox :label="t('Enabled')" v-model="data.isActive" />
|
<QCheckbox :label="t('Enabled')" v-model="data.isActive" />
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
|
Loading…
Reference in New Issue