【问题标题】:Set stepper in second step in clarity design angular在清晰度设计角度的第二步中设置步进器
【发布时间】:2021-01-27 11:00:30
【问题描述】:

当我以清晰设计角度打开页面时,如何在第二步中自动设置步进器?

https://stackblitz.com/edit/clr-stepper-demo

【问题讨论】:

  • 如何让它在初始化时自动打开以打开第 2 页?
  • 我在文档中找不到它

标签: angular vmware-clarity clarity


【解决方案1】:

您可以为第一个下一步按钮设置一个 id。

     <button id="firstButton" clrStepButton="next">next</button>

你可以在ngOnInit()点击它。

     ngOnInit() 
       { 
         let el: HTMLElement = document.getElementById('firstButton');
         el.click();
       }

【讨论】:

  • 即使有值也得到输入无效等错误
  • 你可以在ngAfterViewInit()中试一试。
  • 是的,我在 ngAfterViewInit() 中尝试过,但出现无法读取 null 的属性“有效”等错误
猜你喜欢
  • 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
相关资源
最近更新 更多