步进器 Angular 5|6 HTML CSS 点击事件

Stepper Angular 5|6 HTML CSS Onclick Event

我需要有关步进器进度的点击事件方面的帮助。

例如,我在第 1 步,当我点击 3 时,我将转到第 3 步

我试过点击 <li> 但没有用

这是我的 html 和 CSS

<div class="row">
  <div class="col-xs-12 col-md-8 offset-md-2 block border">
    <div class="wrapper-progressBar">
      <ul class="progressBar">
        <li class="active"></li>
        <li class=""></li>
        <li></li>
        <li></li>
      </ul>
    </div>
  </div>
</div>

CSS

.wrapper-progressBar {
  width: 100%
}

.progressBar {
counter-reset: step;
}

.progressBar li {
  list-style-type: none;
  float: left;
  width: 21%;
  position: relative;
  text-align: center;
}

.progressBar li:before {
  cursor:pointer;
  content: counter(step);
  counter-increment: step;
  line-height: 30px;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  display: block;
  text-align: center;
  margin: 0 auto 10px;
  background-color: white
}

.progressBar li:after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: #ddd;
  top: 15px;
  left: -50%;
  z-index: -1;
}

.progressBar li:first-child:after {
  content: none;
}

.progressBar li.active {
  color: green;
}

.progressBar li.active:before {
  border-color: green;
  background-color: white;
}

.progressBar li.active + li:after {
  background-color: green;
}

https://jsfiddle.net/kingstore/jL6qyft1/3/

"I expect this "

我认为您正在寻找 (click) 事件绑定。

像这样:

<div class="row">
  <div class="col-xs-12 col-md-8 offset-md-2 block border">
    <div class="wrapper-progressBar">
      <ul class="progressBar">
        <li *ngFor="let n of number" [ngClass]="active" (click)="onActive()"></li>
      </ul>
    </div>
  </div>
</div>

检查这个:https://angular.io/guide/user-input