0
鑑於電子的WebView像不能使用電子的屬性的WebView在陣營組件
<webview
minwidth="300"
minheight="300"
src="http://www.javascript-coder.com/files/window-popup/javascript-window-open-example1.html"
allowpopups
></webview>
直接app.html
它工作正常使用。
但是當我在反應組件或ReactDom.render中使用它時,它會省略除src
之外的所有道具。所以,在彈出不要點擊打開:
import React from 'react';
import { render } from 'react-dom';
render(
<webview
minwidth="300"
minheight="300"
src="http://www.javascript-coder.com/files/window-popup/javascript-window-open-example1.html"
allowpopups
/>,
document.getElementById('root')
);
在devtools我得到
警告:未知道具
minwidth
,minheight
,allowpopups
上 標籤。從元素中移除這些道具。有關詳細信息,請參閱 https://facebook.github.io/react/warnings/unknown-prop.html
提示:我用的是最新的https://github.com/chentsulin/electron-react-boilerplate
任何想法?
您可以爲webview添加組件類代碼嗎? –
我添加了一個小例子 – sokki
你可以在組件上嘗試'minWidth'和'minHeight'嗎?注意駱駝 –