Link in paper-item inside paper-menu-button

自闭症网瘾萝莉.ら 提交于 2019-12-12 01:45:52

问题


I'm trying to build a little Flask project using Polymer. I don't think the flask aspect is messing with me. When I click on the 'Edit Species' paper-item I don't go anywhere.

<body>
    <core-header-panel flex>
        <core-toolbar class="medium-tall">
            <paper-menu-button icon="menu">
                <paper-item label="Home" center horizontal layout flex></paper-item>
                <paper-item label="Edit Species" center horizontal layout flex>
                    <a href="/speciesEdit"></a>
                </paper-item>
                    ...more...
            </paper-menu-button>
            ...and so on...

Is there something else I need to do to get the link to work inside a paper-menu-button?

Thanks for your help!


回答1:


I have working code:

 <core-header-panel navigation flex mode="seamed">
      <core-toolbar>Application</core-toolbar>
      <core-menu>
        <core-item icon="settings" label="item1"></core-item>
        <core-item icon="settings" label="item2"></core-item>
        <paper-item label="Edit Species" center horizontal layout flex>
                    <a href="/speciesEdit"></a>
                </paper-item>
      </core-menu>
    </core-header-panel>

this jsbin demo might help you to find your problem. http://jsbin.com/xuveqi




回答2:


For Polymer 1.0, add class="flex" to each of your anchor tags. If you're using Polymer 0.5, use the flex attribute instead of the class.



来源:https://stackoverflow.com/questions/25351793/link-in-paper-item-inside-paper-menu-button

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!