Polymer paper button not displaying

I downloaded the Polymer starter kit (Polymer 1.0) and tried to add a simple paper button to my webpage, but it doesn't display correctly. Here's the relevant code:

<section data-route="home">
      <paper-material elevation="1">

        <paper-button raisedButton
          id='rendered'
          label='patient'
          on-click='{{clickHandler}}'></paper-button>

        <button>Try Me</button>

        <paper-icon-button icon="refresh" label="label"></paper-icon-button>
        <paper-button raisedButton>search!</paper-button>

      </paper-material>

    </section>

      

The first button does not show at all, the second normal button does, the third button works but the label is not displayed, and the last button is displayed as text and cannot be pressed

Result

+3


source to share


2 answers


Has the same issue, apparently does not load the default paper button element.

Fixed it by adding it to the /app/index.html page before the paper button was written out.



<link rel="import" href="/bower_components/paper-button/paper-button.html">

      

Or add it to / app / elements / elements.html

+5


source


paper-button

has no attribute label

or raisedButton

. If you want a button to have a label, you need to write it like a regular button tag. If you want it to have a shadow, you need to add an attribute raised

. paper-icon-button

also has no attribute label

. If you want to display something like this, you can try this instead:



<paper-button raised>
  <iron-icon icon="add"></iron-icon>
  <span>Add Something new</span>
</paper-button>

      

+2


source







All Articles