最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

我想問(wèn)一下為什么我調(diào)用后端的接口,但在瀏覽器中顯示不出來(lái)數(shù)據(jù),是可以在控制臺(tái)中顯示出來(lái)的

我想問(wèn)一下為什么我調(diào)用后端的接口,但在瀏覽器中顯示不出來(lái)數(shù)據(jù),是可以在控制臺(tái)中顯示出來(lái)的

慕碼人1183263 2016-12-16 16:47:03
我的js代碼如下:import React from 'react';import ReactDOM from "react-dom";import reqwest from 'reqwest';import {Table} from 'antd';? ? const columns = [{? ? ? title:'id',? ? ? dataIndex:'id',? ? ? key:'1'? ? },{? ? ? title:'姓名',? ? ? dataIndex:'name',? ? ? key:'2'? ? },{? ? ? title:'性別',? ? ? dataIndex:'gender',? ? ? key:'3'? ? },{? ? ? title:'生日',? ? ? dataIndex:'birthday',? ? ? key:'4'? ? },{? ? ? title:'籍貫',? ? ? dataIndex:'origo',? ? ? key:'5'? ? },{? ? ? title:'職責(zé)',? ? ? dataIndex:'duty',? ? ? key:'6'? ? },{? ? ? title:'圖像',? ? ? dataIndex:'url',? ? ? key:'7'? ? },{? ? ? title:'userId',? ? ? dataIndex:'userId',? ? ? key:'8'? ? }];? ? const Test = React.createClass({? ? ? ? render() {? ? ? ? ? const datas=[];? ? ? ? ? reqwest({? ? ? ? ? ? url: 'http://172.30.140.113:8080/person',? ? ? ? ? ? method: 'get',? ? ? ? ? ? type: 'json',? ? ? ? ? }).then((data) => {? ? ? ? ? ? console.log(data);//這里在控制臺(tái)可以顯示數(shù)據(jù)的? ? ? ? ? ? for(let i=0;i<data.length;i++){? ? ? ? ? ? ? ? datas.push({? ? ? ? ? ? ? ? key:i+1,? ? ? ? ? ? ? ? id:data[i].id,? ? ? ? ? ? ? ? name:data[i].name,? ? ? ? ? ? ? ? url:data[i].avatar,? ? ? ? ? ? ? ? gender:data[i].gender,? ? ? ? ? ? ? ? birthday:data[i].birthday,? ? ? ? ? ? ? ? origo:data[i].origo,? ? ? ? ? ? ? ? duty:data[i].duty,? ? ? ? ? ? ? ? userId:data[i].userId? ? ? ? ? ? ? });? ? ? ? ? ? }? ? ? ? ? ? console.log(datas);//同樣這里在控制臺(tái)也是可以顯示數(shù)據(jù)的? ? ? ? ? });? ? ? ? return (? ? ? ? ? <Table bordered columns={columns}? ? ? ? ? ? dataSource={datas}/>? ? ? ? );? ? ? },? ? });? ? ReactDOM.render(<Test />, document.getElementById('root'));最終在瀏覽器中顯示的結(jié)果是:首先是我的代碼編譯沒(méi)有出錯(cuò)的,可以連接到后端端口顯示數(shù)據(jù)的,在控制臺(tái)那里可以看到顯示的數(shù)據(jù),但不知道為什么用antd的Table就顯示不出來(lái),可以幫幫我解決嗎?
查看完整描述

1 回答

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

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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