代码之家  ›  专栏  ›  技术社区  ›  Minial

扫描后删除二维码

  •  0
  • Minial  · 技术社区  · 8 年前

    正在显示它(<);p>标记错误?

    QR码是从不是从数据库中获取的类型字符串生成的。

    我是否需要有一个数据库和一个脚本,每隔一段时间运行,以检查二维码是否已被读取, 我的假设错了吗?

    //in my file.ts
    createCode() {
    this.createdCode = this.qrData;
    }
    

    //in my file.html
    <ion-card *ngIf="createdCode">
      <ngx-qrcode [qrc-value]="createdCode"></ngx-qrcode>
        <ion-card-content>
          <p>Value: {{ createdCode}}</p>
      </ion-card-content>
    </ion-card>
    

    如果你有任何相关的问题,请一定告诉我,因为我无法在几个小时的时间里找到答案。

    1 回复  |  直到 8 年前
        1
  •  0
  •   Minial    8 年前

    没关系,我只需要添加span类来处理关闭它。

    <span class = 
                "closebtn" onclick="this.parentElement.style.display='none';">&times;
           </span> 
             <ion-card *ngIf="createdCode">
               <ngx-qrcode [qrc-value]="createdCode"></ngx-qrcode>
                    <ion-card-content>
                        <p>Value: {{ createdCode}}</p>
                    </ion-card-content>
                </ion-card>
    

    并存档。SCS添加以下内容以显示关闭按钮。

        .closebtn {
        margin-left: 15px;
        color: white;
        font-weight: bold;
        float: right;
        font-size: 22px;
        line-height: 20px;
        cursor: pointer;
        transition: 0.3s;
        color: black;
    }