我正在尝试<iron-selector>
多选的简单测试。我运行了元素附带的演示项目,似乎从那里工作正常,但每当我将它复制到我的项目时,元素都不会出现。我已经制作了一个Plunker来测试它:Plnkr test link。我正在尝试测试多选项(设置并获取selected-values
)。
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
<script src="https://cdn.rawgit.com/download/polymer-cdn/2.3.1/lib/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/2.3.1/lib/paper-toast/paper-toast.html">
<link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/2.3.1/lib/iron-selector/iron-selector.html">
</head>
<body>
<p>Start:</p>
<iron-selector multi selected-values="[0,2]">
<div>Item 0</div>
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
</iron-selector>
<p>End:</p>
<paper-toast text="Polymer is working!" opened></paper-toast>
</body>
</html>
答案 0 :(得分:1)