聚合物的下拉菜单显示未收回 [英] Polymer's paper-dropdown-menu shows uncollapsed

查看:154
本文介绍了聚合物的下拉菜单显示未收回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Polymer(基于Polymer Starter Kit 1.3)构建一个使用Polymer的小型Web应用程序,我立即遇到了一个问题 - 我正在尝试创建一个包含一个下拉菜单的元素。我已经从



这是我的元素模板:

 < template> 
< style>
:host {
display:block;
}

span {
@apply( - paper-font-body1);
}
< / style>
< paper-dropdown-menu label =恐龙>
< paper-listbox class =dropdown-contentselected =1>
< paper-item> allosaurus< / paper-item>
< paper-item> brontosaurus< / paper-item>
< paper-item> carcharodontosaurus< / paper-item>
< paper-item> diplodocus< / paper-item>
< / paper-listbox>
< / paper-dropdown-menu>
< / template>

这是我第一次使用Polymer(或任何高级网站工具包 - 我更多一个老学校的HTML和Javascript的一个人),我无法找出我在做错什么,甚至如何调试这个。



PSK 1.3中的 app.js 似乎引用了主文件中并不存在的 bottomContainer ,这在控制台中产生了很多警告,但是在我注释掉所有容器的任何提及之后,控制台日志现在看起来很干净 - 但是下拉仍然不能正确呈现。



任何帮助将不胜感激。

解决方案

找出问题所在 - -drowndown-menu.html 元素未由 elements.html 加载。我已经添加了它,一切都很好。



聚合物入门工具包是一种坏的,因为它在几个不同的方面没有正确的工作,新手是面向的,我经常发现自己看不起深渊,考虑是否跳跃...


I'm trying to build a small web app using Polymer, based on the Polymer Starter Kit 1.3, and I've immediately ran into a problem - I'm trying to create an element that contains a drop down menu. I've copy/pasted the example from the documentation but instead of looking like a drop down, it looks like a regular uncollapsed listbox:

This is my element template:

  <template>
    <style>
      :host {
        display: block;
      }

      span {
        @apply(--paper-font-body1);
      }
    </style>
<paper-dropdown-menu label="Dinosaurs">
  <paper-listbox class="dropdown-content" selected="1">
    <paper-item>allosaurus</paper-item>
    <paper-item>brontosaurus</paper-item>
    <paper-item>carcharodontosaurus</paper-item>
    <paper-item>diplodocus</paper-item>
  </paper-listbox>
</paper-dropdown-menu>    
</template>

This is my first time with Polymer (or any "advanced" web site kit - I'm more of an old school HTML and Javascript kind of guy) and I've not been able to find out what I'm doing wrong or even how to debug this.

The app.js in PSK 1.3 seems to reference to a bottomContainer that doesn't actually exist in the main file, and that generated a lot of warnings in the console, but after I commented out any mentions of said container, the console log now looks clean - but the drop down still doesn't render correctly.

Any help will be appreciated.

解决方案

Found out what the problem was - the paper-drowndown-menu.html element was not loaded by elements.html. I've added it and everything is fine.

The Polymer Starter Kit is kind of bad in that its not working out of the box properly in several different aspects and as the newbie it is geared towards, I often find myself looking down at the abyss and considering whether to jump or not...

这篇关于聚合物的下拉菜单显示未收回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆