mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 17:54:30 +08:00
auto hide the dropdown menu when click the menu item
This commit is contained in:
@@ -192,6 +192,7 @@
|
|||||||
:disabled="loading || submitting"
|
:disabled="loading || submitting"
|
||||||
:label="$t('Geographic Location')"
|
:label="$t('Geographic Location')"
|
||||||
v-model="transaction"
|
v-model="transaction"
|
||||||
|
v-model:menu="geoMenuState"
|
||||||
>
|
>
|
||||||
<template #selection>
|
<template #selection>
|
||||||
<span class="cursor-pointer" v-if="transaction.geoLocation">{{ `(${transaction.geoLocation.longitude}, ${transaction.geoLocation.latitude})` }}</span>
|
<span class="cursor-pointer" v-if="transaction.geoLocation">{{ `(${transaction.geoLocation.longitude}, ${transaction.geoLocation.latitude})` }}</span>
|
||||||
@@ -358,6 +359,7 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
transaction: newTransaction,
|
transaction: newTransaction,
|
||||||
geoLocationStatus: null,
|
geoLocationStatus: null,
|
||||||
|
geoMenuState: false,
|
||||||
submitting: false,
|
submitting: false,
|
||||||
isSupportGeoLocation: !!navigator.geolocation,
|
isSupportGeoLocation: !!navigator.geolocation,
|
||||||
resolve: null,
|
resolve: null,
|
||||||
@@ -741,6 +743,7 @@ export default {
|
|||||||
},
|
},
|
||||||
updateGeoLocation(forceUpdate) {
|
updateGeoLocation(forceUpdate) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
self.geoMenuState = false;
|
||||||
|
|
||||||
if (!self.isSupportGeoLocation) {
|
if (!self.isSupportGeoLocation) {
|
||||||
logger.warn('this browser does not support geo location');
|
logger.warn('this browser does not support geo location');
|
||||||
@@ -781,6 +784,7 @@ export default {
|
|||||||
self.geoLocationStatus = 'getting';
|
self.geoLocationStatus = 'getting';
|
||||||
},
|
},
|
||||||
clearGeoLocation() {
|
clearGeoLocation() {
|
||||||
|
this.geoMenuState = false;
|
||||||
this.geoLocationStatus = null;
|
this.geoLocationStatus = null;
|
||||||
this.transaction.geoLocation = null;
|
this.transaction.geoLocation = null;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user