angualr实现双击编辑可修改

```html 文件

<div class=“editinfo” (dblclick)=“editInfo()” title=“双击可编辑”>
<span *ngIf="!editStatus">{{item.sellerSKU}}
<input *ngIf=“editStatus” (blur)=“disableEdit()” class=“form-control” [(ngModel)]=“item.sellerSKU” />


{{item.asin}}



<div class=“editinfo” (dblclick)=“editInfo()” title=“双击可编辑”>
<span *ngIf="!editStatus">{{item.quantityShipped}}
<input *ngIf=“editStatus” (blur)=“disableEdit()” type=“number” class=“form-control” [(ngModel)]=“item.quantityShipped” />

              </td>

ts 文件

  editInfo(){
    this.editStatus  =true;
  }
  disableEdit(){
    this.editStatus = false;
}
delInfo(i){
    console.log(i)
  this.productInfoItems.splice(i,1)
  console.log(this.productInfoItems,"......")
}

搜索库存数:
vaild(){
  if(Number($(".minqty").val())>Number($(".maxqty").val())){
    this.helpeerror = true;
  }else{
    this.helpeerror = false;
  }
}

  doSearch () {
    if(!this.helpeerror) {
      this.batchSearch = [];
      this.loadData();
    }
  }
发布了62 篇原创文章 · 获赞 19 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/sirobot/article/details/102584845
今日推荐