Commit 11599d21 authored by 田翔's avatar 田翔

fix: 地址坐标初始未赋值问题

parent 8d3743a2
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "3.0.2", "version": "3.0.3",
"description": "3.0.2: 测试提交增加提示 ", "description": "3.0.3: 地址坐标初始未赋值问题",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -4,7 +4,7 @@ import { AMap } from '@wisdom-map/amap' ...@@ -4,7 +4,7 @@ import { AMap } from '@wisdom-map/amap'
const SearchLocation = (props) => { const SearchLocation = (props) => {
const { value, onChange, name, schema, addons } = props const { value, onChange, name, schema, addons } = props
const { disabled, placeholder } = schema const { disabled, placeholder, presetValue } = schema
const [extraData, setExtraData] = useState(null); const [extraData, setExtraData] = useState(null);
const [address, setAddress] = useState(''); const [address, setAddress] = useState('');
...@@ -44,6 +44,12 @@ const SearchLocation = (props) => { ...@@ -44,6 +44,12 @@ const SearchLocation = (props) => {
} }
} }
useEffect(() => {
if (addons) {
addons.setValue(addons.dataPath, presetValue)
}
}, [presetValue])
useEffect(() => { useEffect(() => {
if (addons) { if (addons) {
renderSearch() renderSearch()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment