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

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

根據(jù) ID 顯示特定數(shù)據(jù)

根據(jù) ID 顯示特定數(shù)據(jù)

回首憶惘然 2021-10-07 10:38:05
以下代碼顯示來自我的數(shù)據(jù) API 的標(biāo)記列表,在標(biāo)記單擊時,它使用用戶單擊的標(biāo)記的 ID 設(shè)置 selectedMarker 狀態(tài)。getPosts() {    axios      .get("mydataAPI")      .then(response => {        this.setState({          posts: response.data.response        });      });  }///This code is then returned to the user with MapView to display a list of markers on map, when a user clicks a marker the ID of that marker is stored in state /// {this.state.posts.map((user, index)=> {       return (        <MapView.Marker key={user.ID} coordinate={{latitude: user.lat, longitude: user.lng}} onPress={() => {this.setState({selectedMarker: user.ID})}}  title={user.category} description={Moment(user.post_date).fromNow(), user.category, user.address} image={require('../images/yes.png')}/>          );                 })}//// will display ID of marker user selected ////{ this.state.selectedMarker }現(xiàn)在我已將標(biāo)記 ID 保存為狀態(tài),如何使用 .map 函數(shù)根據(jù)其 ID 顯示有關(guān)該特定標(biāo)記的信息?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 202 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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