2017-10-04 145 views
0

我试过在文件上查找或在stackoverflow或在线搜索其他类似的问题,但它不是我正确使用谷歌搜索。我不知道如何删除后QRCode它已被扫描。扫描后删除QR码

显示在< p> tag错了吗?

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

我需要一个数据库和一个脚本运行间隔,检查QR码是否被读取, 我假设错了吗?

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

我显示扫描QR码

//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> 

如果有,你有遇到任何有关问题,请做参考我给它,因为我不能在少数针点几小时的低谷。

预先感谢您!

回答

0

没关系,我只需要添加处理关闭它的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> 

并在file.scss中添加以下内容来显示关闭按钮。

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