Skip to content

Commit

Permalink
fix: demo emit
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Dec 20, 2023
1 parent dad387d commit 6723095
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ function MapComponent() {

async function handleClickTree(tree) {
log.warn('click tree:', tree);
if (window.parent) {
log.warn('DEMO:ok message parent');
window.parent.postMessage(tree, '*');
}

const wholeTree = await getTreeById(tree.id).catch((err) => log.warn(err));
const result = pathResolver.getPathWhenClickTree(
Expand Down Expand Up @@ -168,6 +172,11 @@ function MapComponent() {
const isAdmin = !!router.asPath.match(/admin/);
if (!isAdmin) {
map.on(Map.REGISTERED_EVENTS.MOVE_END, () => {
log.warn('DEMO: move end:');
if (window.parent) {
log.warn('DEMO: ok message parent');
window.parent.postMessage('DEMO foo', '*');
}
log.warn('update url');
const path = pathResolver.updatePathWhenMapMoveEnd(
window.location,
Expand Down

0 comments on commit 6723095

Please sign in to comment.