并决定通过执行以下操作来创建对话框:
<dom-module id="sample-dialog">
<template>
<paper-dialog-impl>
<h2>{{title}}</h2>
<div>
<content></content>
</div>
<div class="buttons">
<paper-button dialog-dismiss on-tap="cancel">Cancel</paper-button>
<paper-button dialog-confirm on-tap="submit">Accept</paper-button>
</div>
</paper-dialog-impl>
</template>
</dom-module>
它渲染到屏幕,但没有样式。我读到: paper-dialog-shared-styles.html为标题,内容区域和按钮的操作区域提供样式,但我不知道如何实现它。我试图使用link
标签,但这不起作用。具体来说,我在模板中尝试了:<link rel="import" href="polymer_elements/src/paper-dialog-behavior/paper-dialog-shared-styles.html" />
在我的dart文件中,我也导入了这些文件,认为它可以解决。
import 'package:polymer_elements/paper_button.dart';
import 'package:polymer_elements/paper_dialog_behavior.dart';
编辑:现在,我有一个实现扩展Polymer Element的类,这是有道理的。我只是不确定是否需要扩展其他内容。
编辑2:将此更新为标准paper-dialog
,除非现在根本不会渲染项目,即使在更新dart后端的导入后也是如此。
答案 0 :(得分:1)
将其更新为纸质对话框后,需要将一个属性应用于纸张对话框,以使其可见或不可见。这是打开的属性。
将其添加到内部Option Explicit
Sub CollectTerms()
Dim wsSrc As Worksheet, wsRes As Worksheet, rRes As Range
Dim vSrc As Variant, vRes() As Variant
Dim cT As cTerm, colT As Collection
Dim sHeader As String, lHeaders As Long
Dim I As Long, J As Long
'Set Source and Results worksheets, Results range
Set wsSrc = Worksheets("sheet1")
Set wsRes = Worksheets("sheet2")
Set rRes = wsRes.Cells(1, 1)
'Get Source data
With wsSrc
vSrc = Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
End With
'Collect header list for each Term
Set colT = New Collection
On Error Resume Next
For I = 1 To UBound(vSrc, 1)
'Is it a header?
If Not IsNumeric(vSrc(I, 1)) Then
Set cT = New cTerm
With cT
.Term = vSrc(I, 1)
.ADDHeader (sHeader)
colT.Add cT, CStr(.Term)
Select Case Err.Number
Case 457
colT(CStr(.Term)).ADDHeader (sHeader)
Err.Clear
Case Is <> 0
Debug.Print Err.Number, Err.Description
End Select
'keep track of column count
lHeaders = IIf(lHeaders > colT(CStr(.Term)).Headers.Count, lHeaders, colT(CStr(.Term)).Headers.Count)
End With
Else
sHeader = vSrc(I, 1)
End If
Next I
On Error GoTo 0
'Create Results Array
ReDim vRes(1 To colT.Count, 1 To lHeaders + 1)
For I = 1 To UBound(vRes, 1)
With colT(I)
vRes(I, 1) = .Term
For J = 1 To .Headers.Count
vRes(I, J + 1) = .Headers(J)
Next J
End With
Next I
Set rRes = rRes.Resize(UBound(vRes, 1), UBound(vRes, 2))
With rRes
.EntireColumn.Clear
.Value = vRes
.Sort key1:=.Columns(1), order1:=xlAscending, Header:=xlNo, MatchCase:=False
End With
End Sub
会使其可见。
因此,因此,通过外部打开将其传递到纸质对话框,将使其切换打开/关闭。
paper-dialog
标记中的:
//in the sample-dialog dart
@property bool opened = false;
然后我现在可以说:
<paper-dialog opened$="{{opened}}" ...>