【问题标题】:Kendo Angular Tabstrip wrapperKendo Angular Tabstrip 包装器
【发布时间】:2018-08-29 11:55:46
【问题描述】:

我想包装剑道标签条以将所有标签放在一个位置,并且每当我想更改标签组件时只需更改一个位置。考虑到这一点,我开始包装剑道标签条,但它不起作用。在这一点上我真的很困惑。这是我的代码:
自定义标签条.html

<kendo-tabstrip>
  <ng-content></ng-content>
</kendo-tabstrip>

custom-tab-component.html:

<kendo-tabstrip-tab [title]="title" [selected]="selected">
  <ng-template kendoTabContent>
    <ng-content></ng-content>
  </ng-template>
</kendo-tabstrip-tab>

其中 title 和 selected 是此组件中的输入。
最后我使用这些组件如下:

<app-custom-tab-strip>
    <app-custom-tab [title]="'title'" [selected]="true">
        test
    </app-custom-tab>
</app-custom-tab-strip>

谁能帮我找出我的代码的问题?

【问题讨论】:

    标签: angular user-interface kendo-ui-angular2


    【解决方案1】:

    你必须使用 @Input() 和 @output() 发射器作为标题和选定的属性,因为当父组件调用子组件时,你必须为此传递 2 个值,因为它会设置运行时间。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多