{"id":37973,"date":"2023-07-20T10:17:46","date_gmt":"2024-03-01T06:50:59","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/"},"modified":"2024-04-30T14:26:46","modified_gmt":"2024-04-30T06:26:46","slug":"react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/","title":{"rendered":"[React] \u4f7f\u7528 React Iframe \u7ec4\u4ef6\u6765\u663e\u793a HTML \u4fe1\u606f"},"content":{"rendered":"<h2>\u9996\u5148<\/h2>\n<p>\u6211\u5c06\u5199\u4e0b\u4f7f\u7528 React Ifame \u6765\u663e\u793a HTML \u7684 URL \u7684\u65b9\u6cd5\u3002<\/p>\n<h2>\u8bf7\u53c2\u8003<\/h2>\n<p>\u4ee5\u4e0b\u662f\u6587\u4ef6\u7684\u94fe\u63a5\uff1a<br \/>\nhttps:\/\/www.npmjs.com\/package\/react-iframe<\/p>\n<h2>\u5b89\u88c5 React Iframe<\/h2>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5React Iframe\u3002<\/p>\n<pre class=\"post-pre\"><code>npm install react-iframe\r\n<\/code><\/pre>\n<p>\u68c0\u67e5package.json\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code>\"dependencies\": {\r\n    \"react-iframe\": \"^1.8.5\",\r\n  },\r\n<\/code><\/pre>\n<h2>\u9002\u7528\u4e8e\u4ee3\u7801<\/h2>\n<p>\u4e3a\u4e86\u4f7f\u7528React Ifame\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u4ee3\u7801\u3002\u8fd9\u6b21\u6211\u4eec\u5c06\u4f7f\u7528\u901a\u8fc7News API\u83b7\u53d6\u5230\u7684URL\u3002<\/p>\n<pre class=\"post-pre\"><code>import Iframe from \"react-iframe\";\r\n\r\n&lt;Iframe \r\n url={\"https:\/\/www3.nhk.or.jp\/news\/html\/20231007\/k10014218571000.html\"} \r\n width=\"100%\"\r\n height=\"1000px\"\r\n\/&gt;\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d318537434c4406c5f355\/12-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-10-09 17.40.40.png\" \/><\/div>\n<h2>\u6700\u540e<\/h2>\n<p>\u56e0\u4e3a\u6211\u8fd8\u5199\u4e86\u5f88\u591a\u5176\u4ed6\u7684\u6587\u7ae0\uff0c\u6240\u4ee5\u5982\u679c\u613f\u610f\u7684\u8bdd\uff0c\u8bf7\u591a\u591a\u9605\u8bfb&#8230;<\/p>\n<p>\u5173\u4e8e\u57fa\u672c\u8bbe\u8ba1<br \/>\n\u4f7f\u7528Vue.js\u548cNode.js\u5f00\u53d1\u4e86\u4e00\u4e2a\u804a\u5929\u5e94\u7528<br \/>\n\u4f7f\u7528Next.js\u548cTypeScript\u521b\u5efa\u4e86\u4e00\u4e2aTODO\u5e94\u7528<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u6211\u5c06\u5199\u4e0b\u4f7f\u7528 React Ifame \u6765\u663e\u793a HTML \u7684 URL \u7684\u65b9\u6cd5\u3002 \u8bf7\u53c2\u8003 \u4ee5\u4e0b\u662f\u6587\u4ef6\u7684\u94fe\u63a5\uff1a [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37973","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[React] \u4f7f\u7528 React Iframe \u7ec4\u4ef6\u6765\u663e\u793a HTML \u4fe1\u606f - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/react-\u4f7f\u7528-react-iframe-\u7ec4\u4ef6\u6765\u663e\u793a-html-\u4fe1\u606f\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[React] \u4f7f\u7528 React Iframe \u7ec4\u4ef6\u6765\u663e\u793a HTML \u4fe1\u606f\" \/>\n<meta property=\"og:description\" content=\"\u9996\u5148 \u6211\u5c06\u5199\u4e0b\u4f7f\u7528 React Ifame \u6765\u663e\u793a HTML \u7684 URL \u7684\u65b9\u6cd5\u3002 \u8bf7\u53c2\u8003 \u4ee5\u4e0b\u662f\u6587\u4ef6\u7684\u94fe\u63a5\uff1a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/react-\u4f7f\u7528-react-iframe-\u7ec4\u4ef6\u6765\u663e\u793a-html-\u4fe1\u606f\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-01T06:50:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T06:26:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d318537434c4406c5f355\/12-0.png\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/\",\"name\":\"[React] \u4f7f\u7528 React Iframe \u7ec4\u4ef6\u6765\u663e\u793a HTML \u4fe1\u606f - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2024-03-01T06:50:59+00:00\",\"dateModified\":\"2024-04-30T06:26:46+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[React] \u4f7f\u7528 React Iframe \u7ec4\u4ef6\u6765\u663e\u793a HTML \u4fe1\u606f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"[React] \u4f7f\u7528 React Iframe \u7ec4\u4ef6\u6765\u663e\u793a HTML \u4fe1\u606f - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/react-\u4f7f\u7528-react-iframe-\u7ec4\u4ef6\u6765\u663e\u793a-html-\u4fe1\u606f\/","og_locale":"zh_CN","og_type":"article","og_title":"[React] \u4f7f\u7528 React Iframe \u7ec4\u4ef6\u6765\u663e\u793a HTML \u4fe1\u606f","og_description":"\u9996\u5148 \u6211\u5c06\u5199\u4e0b\u4f7f\u7528 React Ifame \u6765\u663e\u793a HTML \u7684 URL \u7684\u65b9\u6cd5\u3002 \u8bf7\u53c2\u8003 \u4ee5\u4e0b\u662f\u6587\u4ef6\u7684\u94fe\u63a5\uff1a [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/react-\u4f7f\u7528-react-iframe-\u7ec4\u4ef6\u6765\u663e\u793a-html-\u4fe1\u606f\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-03-01T06:50:59+00:00","article_modified_time":"2024-04-30T06:26:46+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d318537434c4406c5f355\/12-0.png"}],"author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/","name":"[React] \u4f7f\u7528 React Iframe \u7ec4\u4ef6\u6765\u663e\u793a HTML \u4fe1\u606f - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2024-03-01T06:50:59+00:00","dateModified":"2024-04-30T06:26:46+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"[React] \u4f7f\u7528 React Iframe \u7ec4\u4ef6\u6765\u663e\u793a HTML \u4fe1\u606f"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/react-%e4%bd%bf%e7%94%a8-react-iframe-%e7%bb%84%e4%bb%b6%e6%9d%a5%e6%98%be%e7%a4%ba-html-%e4%bf%a1%e6%81%af\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=37973"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37973\/revisions"}],"predecessor-version":[{"id":92451,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37973\/revisions\/92451"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=37973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=37973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=37973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}