美文网首页
3-10 Global Polymer settings 全局P

3-10 Global Polymer settings 全局P

作者: 1bdd9a4a74a2 | 来源:发表于2015-12-18 17:55 被阅读48次

layout: default
type: guide
shortname: Docs
title: Global Polymer settings
subtitle: Developer guide

Document-level global Polymer settings can be set by creating a Polymer object on window before importing the Polymer library:
文档级别全局Polymer设置能够在导入Polymer库前被在window上创建一个Polymer对象来设置
<html>
<head>
<meta charset="utf-8">
<script src="components/webcomponentsjs/webcomponents-lite.js"></script>
<script>
window.Polymer = window.Polymer || {};
window.Polymer.dom = 'shadow';
</script>


<link rel="import" href="elements/my-app.html">
</head>
<body>

  ...

Note: The full version of webcomponents.js includes a stub version
of the Polymer function. Setting the value this way avoids overwriting the
stub.
{: .alert .alert-info }

Settings can also be switched on the URL query string:

http://myserver.com/test-app/index.html?dom=shadow

Available settings:

  • dom—options:
    • shady. All local DOM is rendered using shady DOM, even where shadow DOM is supported (current default).
    • shadow. Local DOM is rendered using shadow DOM where supported (this will be the default in the future).

相关文章

网友评论

      本文标题:3-10 Global Polymer settings 全局P

      本文链接:https://www.haomeiwen.com/subject/adkphttx.html