4
聚合物文件(https://elements.polymer-project.org/elements/iron-input),我發現:在聚合物中,爲什麼使用`<input is =「iron-input」>「而不是`<iron-input>`?
<input is="iron-input" bind-value="{{myValue}}">
而在另一個官方文件(https://www.polymer-project.org/1.0/docs/devguide/registering-elements.html#type-extension),我發現:
<dom-module id="main-document-element">
<template>
<p>
Hi! I'm a Polymer element that was defined in the
main document!
</p>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'main-document-element'
});
});
</script>
</dom-module>
<main-document-element></main-document-element>
我只是想知道爲什麼第一個<input is="iron-input" bind-value="{{myValue}}">
可以」寫成<iron-input bind-value="{{myValue}}">
。
它是否兼容,這使得它更容易填充?