1
是否可以从聚合物1中的子元素中选择内容?在文档中找不到任何关于它的内容,但这不起作用:是否可以从子元素中选择内容?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://rawgit.com/webcomponents/webcomponentsjs/master/webcomponents.js"></script>
<base href="http://polygit.org/polymer+:master/components/">
<link rel="import" href="polymer/polymer.html">
<dom-module id="my-element">
<template>
<content select="#aaa"></content>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: "my-element"
});
});
</script>
</dom-module>
</head>
<body>
<my-element>
<div>
<div id="aaa">zzzzzzzzzzz</div>
</div>
</my-element>
</body>
</html>
2jamLêĐình:请您指出确切位置?找不到任何内容,但“元素支持通过简单选择器过滤节点的select属性。”没有人会说这个应该只在顶级elt上工作。在很多情况下,从深层获得专业技能将非常方便。 –
user656449