无法访问iframe地址
index.js文件
import React from 'react';
import ReactDOM from 'react-dom'; import App from './App'; ReactDOM.render(<App />, document.getElementById('root'));
App.js
import React from 'react'
class App extends React.Component { render() { return ( <div> <h1>Outside iFrame</h1> <iframe title="myiframe" src="./target.html" width="600px" height="400px"></iframe> </div> ) } } export default App
target.html
<html>
<head></head> <body> <h1>Inside IFrame</h1> </body> </html>
index.html
<div id="root"></div>
为什么引入的是
<iframe title="myiframe" src="./target.html" width="600px" height="400px"></iframe>