第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

SVG(使用 React Simple Maps)不顯示在移動設(shè)備上

SVG(使用 React Simple Maps)不顯示在移動設(shè)備上

墨色風(fēng)雨 2023-05-25 16:40:21
我目前正在構(gòu)建一個 React 應(yīng)用程序,其中包含一個使用React Simple Maps構(gòu)建的交互式 SVG 地圖。在我的桌面瀏覽器中,一切都按預(yù)期工作,但是地圖本身不會加載到移動設(shè)備上(我已經(jīng)測試了幾個)而且我不明白為什么。我在下面包含了相關(guān)組件的代碼(我刪除了代碼中一些不相關(guān)的部分):import React, { memo, Component } from 'react';import { ZoomableGroup, ComposableMap, Geographies, Geography } from "react-simple-maps";import geoUrl from "../data/topo.json";import Country from './Country'import { CSSTransition, SwitchTransition } from "react-transition-group";class Map extends Component {?? ? constructor(props){? ? ? ? super(props);? ? ? ? this.state = {? ? ? ? ? ? country: "",? ? ? ? ? ? dish: "",? ? ? ? ? ? description: "",? ? ? ? ? ? photo: "",? ? ? ? ? ? recipe: "",? ? ? ? ? ? selected: false,? ? ? ? }? ? ? ? this.handleBack = this.handleBack.bind(this);? ? ? ? this.handleAbout = this.handleAbout.bind(this);? ? ? ? this.handleList = this.handleList.bind(this);? ? }? ? handleEnter(country, dish, description, photo, recipe){? ? ? ? this.setState({? ? ? ? ? ? country: country,? ? ? ? ? ? dish: dish,? ? ? ? ? ? description: description,? ? ? ? ? ? photo: photo,? ? ? ? ? ? recipe: recipe? ? ? ? })? ? }? ??? ? render(){?? ??? ? ? ? const { country, dish, description, photo, recipe, selected } = this.state;? ? ? ? const countries = geoUrl.objects.ne_50m_admin_0_countries.geometries;? ? ? ? return(? ? ? ? ? ? <SwitchTransition>? ? ? ? ? ? ? ? <CSSTransition? ? ? ? ? ? ? ? ? ? classNames="transition"? ? ? ? ? ? ? ? ? ? transitionAppearTimeout={50000}? ? ? ? ? ? ? ? ? ? key={ selected }? ? ? ? ? ? ? ? ? ? in={ selected }? ? ? ? ? ? ? ? ? ? unmountOnExit? ? ? ? ? ? ? ? ? ? appear? ? ? ? ? ? ? ? >? ? ? ? ?? ? ? ? ? ? ? ? ? ? <>?如果有人可能有任何見解,那將是太棒了!如果您想查看更多代碼/屏幕截圖等,請告訴我。謝謝!javascript反應(yīng)反應(yīng)本機(jī)svg地圖
查看完整描述

1 回答

?
慕工程0101907

TA貢獻(xiàn)1887條經(jīng)驗(yàn) 獲得超5個贊

style={{width: "100%"}}- 通過添加to的屬性<ComposableMap>,問題現(xiàn)在似乎已解決!這不應(yīng)該替換width="1200"屬性(如果你刪除這個地圖將不會在移動或桌面上呈現(xiàn)),但應(yīng)該是除了它:

<ComposableMap?width="1200"?style={{?width:?"100%"?}}?data-tip=""?projectionConfig={{?scale:?200?}}?>



查看完整回答
反對 回復(fù) 2023-05-25
  • 1 回答
  • 0 關(guān)注
  • 143 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號