You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
711 B
31 lines
711 B
|
3 years ago
|
import { reactive } from "vue-demi";
|
||
|
|
import { SearchLocalState, SearchResultState, SearchViewState } from "../types";
|
||
|
|
|
||
|
|
export function useState() {
|
||
|
|
const searchLocalState: SearchLocalState = {
|
||
|
|
tdtMap: null,
|
||
|
|
localSearch: null,
|
||
|
|
keyword: "",
|
||
|
|
queryType: 1,
|
||
|
|
showRoute: false
|
||
|
|
};
|
||
|
|
const searchResultState: SearchResultState = {
|
||
|
|
pois: false,
|
||
|
|
statistics: false,
|
||
|
|
area: false,
|
||
|
|
suggests: false,
|
||
|
|
prompt: false,
|
||
|
|
lineData: false
|
||
|
|
};
|
||
|
|
const searchViewState: SearchViewState = {
|
||
|
|
markers: [],
|
||
|
|
target: null,
|
||
|
|
content: "",
|
||
|
|
current: 1,
|
||
|
|
total: 0
|
||
|
|
};
|
||
|
|
const state = reactive({ ...searchLocalState, ...searchResultState, ...searchViewState });
|
||
|
|
|
||
|
|
return state;
|
||
|
|
}
|