mar*_*rvz 7 cordova polymer-2.x
我正在尝试使用Polymer 2.0创建混合应用程序.我使用了聚合物-2应用和聚合物-2启动子试剂盒样品,它在safari浏览器上测试时正常工作.
但是当我在iOS模拟器上运行它时,Polymer元素没有显示出来.
这是我的示例index.html
<!DOCTYPE html>
<html>
<head>
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
<link rel="stylesheet" type="text/css" href="css/index.css">
<meta name="description" content="TestPolymer-2 description">
<link rel="manifest" href="/manifest.json">
<script src="bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="src/test-element/test-element.html">
<title>Hello World</title>
</head>
<body>
<div class="app">
<test-element></test-element>
<h1>Apache Cordova</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
问题是 Polymer 2 HTML 导入在 iOS < 10.3 上不起作用。为了让它工作,你需要一个Polyfill。
请参阅 Polymer 2支持图表。
此外,Polymer 2 使用 ES6,仅在 iOS 10+ 上受支持,要在 iOS 9 上使用它,您必须将应用程序编译为 ES5。
但鉴于 iOS 10 的支持率为 86%,我建议您放弃 iOS 9,仅在应用程序中支持 iOS 10。
归档时间: |
|
查看次数: |
926 次 |
最近记录: |