@uiw/react-amap-info-window
Advanced tools
Comparing version
@@ -43,3 +43,3 @@ "use strict"; | ||
(0, _react.useEffect)(function () { | ||
return (0, _reactDom.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", { | ||
return (0, _reactDom.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, { | ||
children: children | ||
@@ -46,0 +46,0 @@ }), container); |
import _extends from "@babel/runtime/helpers/extends"; | ||
import { render } from 'react-dom'; | ||
import React, { useEffect, useImperativeHandle, useMemo } from 'react'; | ||
import React, { useEffect, useImperativeHandle, useMemo, Fragment } from 'react'; | ||
import { useInfoWindow } from './useInfoWindow'; | ||
@@ -12,3 +12,3 @@ import { jsx as _jsx } from "react/jsx-runtime"; | ||
var container = useMemo(() => document.createElement('div'), []); | ||
useEffect(() => render( /*#__PURE__*/_jsx("div", { | ||
useEffect(() => render( /*#__PURE__*/_jsx(Fragment, { | ||
children: children | ||
@@ -15,0 +15,0 @@ }), container), [children]); |
{ | ||
"name": "@uiw/react-amap-info-window", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "用于在地图上弹出一个详细信息展示窗体,地图上只允许同时展示 `1` 个信息窗体。", | ||
@@ -37,4 +37,4 @@ "homepage": "https://uiwjs.github.io/react-amap/#/info-window", | ||
"dependencies": { | ||
"@uiw/react-amap-map": "2.3.0", | ||
"@uiw/react-amap-utils": "2.3.0" | ||
"@uiw/react-amap-map": "2.4.0", | ||
"@uiw/react-amap-utils": "2.4.0" | ||
}, | ||
@@ -41,0 +41,0 @@ "devDependencies": { |
@@ -56,4 +56,6 @@ InfoWindow 信息窗体 | ||
### 基本用法 | ||
### 支持 ReactNode | ||
通过 `children` 支持 `React` 的方式展现内容,因为窗口信息内容通过 `content` 展示内容,它支持 `string/HTMLElement` 添加事件并不方便。 | ||
<!--rehype:bgWhite=true&noScroll=true&codeSandbox=true&codeSandbox=true--> | ||
@@ -81,15 +83,13 @@ ```jsx | ||
> | ||
<div> | ||
<div style={{ display: 'flex', justifyContent: 'space-between', paddingBottom: 10 }}> | ||
<img height={16} src="https://webapi.amap.com/images/autonavi.png"/> | ||
<h2> | ||
<span style={{color: 'red'}}>{num}</span> - 高德软件 | ||
</h2> | ||
</div> | ||
<p>电话:010-84107000 邮编:100102</p> | ||
<p>地址:北京市朝阳区望京阜荣街10号首开广场4层</p> | ||
<button onClick={() => setNum(num + 1)}> | ||
点击事件 + 1 | ||
</button> | ||
<div style={{ display: 'flex', justifyContent: 'space-between', paddingBottom: 10 }}> | ||
<img height={16} src="https://webapi.amap.com/images/autonavi.png"/> | ||
<h2> | ||
<span style={{color: 'red'}}>{num}</span> - 高德软件 | ||
</h2> | ||
</div> | ||
<p>电话:010-84107000 邮编:100102</p> | ||
<p>地址:北京市朝阳区望京阜荣街10号首开广场4层</p> | ||
<button onClick={() => setNum(num + 1)}> | ||
点击事件 + 1 | ||
</button> | ||
</InfoWindow> | ||
@@ -96,0 +96,0 @@ </Map> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
34566
0.73%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated