import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useCoordinateStore = defineStore('coordinate', () => {
  const place = ref({})
  const modifyPlace = ref({})
  const changePlace = (val) => {
    place.value = val
    // console.log('改变的值', place.value)
  }
  const changeModifyPlace = (val) => {
    modifyPlace.value = val
  }
  const addPlace = ref({ lat: 28.7052848, lng: 113.5759597 })
  const changeAddPlace = (val) => {
    addPlace.value = val
  }
  return {
    place,
    changePlace,
    modifyPlace,
    changeModifyPlace,
    addPlace,
    changeAddPlace
  }
})
