feat: dashIfEmpty
This commit is contained in:
parent
19121fbeb9
commit
d71029c7e9
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, useAttrs, onBeforeMount, capitalize } from 'vue';
|
import { ref, reactive, useAttrs, onBeforeMount, capitalize } from 'vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { parsePhone } from 'src/filters';
|
import { dashIfEmpty, parsePhone } from 'src/filters';
|
||||||
import useOpenURL from 'src/composables/useOpenURL';
|
import useOpenURL from 'src/composables/useOpenURL';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -31,9 +31,8 @@ onBeforeMount(async () => {
|
||||||
if (!channel) channel = defaultChannel;
|
if (!channel) channel = defaultChannel;
|
||||||
|
|
||||||
phone.value = await parsePhone(props.phoneNumber, props.country?.toLowerCase());
|
phone.value = await parsePhone(props.phoneNumber, props.country?.toLowerCase());
|
||||||
config[
|
config[type].url =
|
||||||
type
|
`${url}?customerIdentity=%2B${phone.value}&channelId=${channel}`;
|
||||||
].url = `${url}?customerIdentity=%2B${phone.value}&channelId=${channel}`;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -57,5 +56,6 @@ function handleClick() {
|
||||||
{{ capitalize(type).replace('-', '') }}
|
{{ capitalize(type).replace('-', '') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
{{ phoneNumber }}
|
|
||||||
|
<span>{{ dashIfEmpty(phone) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue