纸张图标按钮在应用程序工具栏区域中不可见



学习聚合物的布局,纸张图标按钮在应用程序工具栏区域中不可见,代码为 '

<!-- sample-content included for demo purposes only -->
<link rel="import" href="app-layout/demo/sample-content.html">
<link rel="import" href="iron-icon/iron-icon.html">
<link rel="import" href="paper-styles/paper-styles.html">
<link rel="import" href="paper-icon-button/paper-icon-button.html">
<style is="custom-style">
    body {
        /* No margin on body so toolbar can span the screen */
        margin: 0;
    }
    app-toolbar {
        /* Toolbar is the main header, so give it some color */
        background-color: #1E88E5;
        font-family: 'Roboto', Helvetica, sans-serif;
        color: white;
        --app-toolbar-font-size: 24px;
    }
</style>
</head>
<body>
<app-toolbar>
<paper-icon-button icon="menu"></paper-icon-button>
<div title>Spork</div>
<paper-icon-button icon="search"></paper-icon-button>
</app-toolbar>
</body>`

2,知道为什么吗?谢谢

正确的输出应该是:[带按钮的应用程序工具栏][3]

巴迪·

您缺少包含searchmenu图标的iron-icons导入。包括这个应该可以解决您的问题<link rel="import" href="iron-icons/iron-icons.html">

<base href="https://polygit.org/components/">
<link rel="import" href="app-layout/demo/sample-content.html">
<link rel="import" href="iron-icon/iron-icon.html">
<link rel="import" href="iron-icons/iron-icons.html">
<link rel="import" href="paper-styles/paper-styles.html">
<link rel="import" href="paper-icon-button/paper-icon-button.html">
<style is="custom-style">
  body {
    /* No margin on body so toolbar can span the screen */
    margin: 0;
  }
  app-toolbar {
    /* Toolbar is the main header, so give it some color */
    background-color: #1E88E5;
    font-family: 'Roboto', Helvetica, sans-serif;
    color: white;
    --app-toolbar-font-size: 24px;
  }
</style>
</head>
<body>
  <app-toolbar>
    <paper-icon-button icon="menu"></paper-icon-button>
    <div title>Spork</div>
    <paper-icon-button icon="search"></paper-icon-button>
  </app-toolbar>
</body>

最新更新