0👍
import { reactive, computed } from "vue";
const mapObject = reactive({
lat: 0,
long: 0,
});
const esriObject = computed(() => {
return [mapObject.lat, mapObject.long];
});
export const useEsriMap = () => {
const panTo = (lat, long) => {
mapObject.lat = lat;
mapObject.long = long;
};
return {
panTo,
esriObject,
};
};
- [Vuejs]-How to access the value of a ref in Vue 3?
- [Vuejs]-In Vue.js, how can I add additional parameters alongside an emit?
Source:stackexchange.com