0
文本落在对话框之外

文本落在对话框之外

这是笨蛋

我想实现neon-animated-pagespaper-tabs内部控制paper-dialog

我希望看到 的内容tab-atab-b包含paper-dialogpaper-dialog.

我错过了什么?

http://plnkr.co/edit/bPUclBOpghNFVmKMbOzc?p=preview
<link href="tab-a.html" rel="import">
<link href="tab-b.html" rel="import">

<base href="https://polygit.org/polymer+:master/iron-data-table+Saulis+:master/components/">
<link rel="import" href="polymer/polymer.html">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>

<link rel="import" href="paper-dialog/paper-dialog.html">
<link rel="import" href="paper-tabs/paper-tabs.html">
<link rel="import" href="iron-pages/iron-pages.html">
<link rel="import" href="neon-animation/neon-animation.html">
<link rel="import" href="neon-animated-pages/neon-animated-pages.html">

<dom-module id="content-el">
    <template>
        <style></style>

    <button on-tap="open">Open Dialog</button>

    <paper-dialog id="dialog" modal>
      <h2>Dialog Title</h2>

      <paper-tabs selected="{{selected}}">
        <paper-tab>Tab 1</paper-tab>
        <paper-tab>Tab 2</paper-tab>
      </paper-tabs>

      <neon-animated-pages selected="{{selected}}">
        <tab-a entry-animation="slide-from-left-animation"
               exit-animation="slide-left-animation"
        ></tab-a>
        <tab-b entry-animation="slide-from-right-animation"
               exit-animation="slide-right-animation"
        ></tab-b>
      </neon-animated-pages>

    </paper-dialog>

    </template>

  <script>
    (function() {
      'use strict';
      Polymer({
        is: 'content-el',

                behaviors: [
                    Polymer.NeonAnimationRunnerBehavior,
                    Polymer.NeonAnimatableBehavior,
                    Polymer.IronResizableBehavior,
                ],

        properties: {
          selected: {
            type: Number,
            value: 0
          }
        },
        open: function() {
          this.$.dialog.open();
        },
      });
        })();
  </script>
</dom-module>
4

1 回答 1

2

对话框外的内容在里面<neon-animated-pages>,并且检查<neon-animated-pages>显示它没有高度:

在此处输入图像描述

要解决此问题,请将 CSS 样式应用于<paper-dialog><neon-animated-pages>以设置它们的宽度/高度;并overflow在页面上设置以允许滚动。例如:

<dom-module id="content-el">
<template>
  <style>
    paper-dialog {
      width: 75%;
      min-width: 50vw;
    }
    neon-animated-pages {
      margin: 2em;
      height: 100%;
      min-height: 25vh;
      overflow: auto;
    }
  </style>
  ...
</template>
</dom-module>

笨蛋

于 2017-01-05T07:15:44.583 回答