问题
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