簡體   English   中英

離子3按鈕在離子含量范圍內不可單擊

[英]Ionic 3 Buttons are not clickable within ion-content

我有一些在離子含量內無法點擊的按鈕。 當我把它們帶出來時,它們工作得很好。 這是我的HTML和SCSS。 非常奇怪的行為,也許我錯過了什么?

<ion-content no-bounce>
  <div class="content_cover_exit">
    <button class="exit-button" (click)="logoutUser()">
      <ion-icon name="ios-exit-outline" class="icon-exit-class"></ion-icon>
      EXIT
    </button>
  </div>
</ion-content>


  .content_cover_exit {
    width: 100%;
    text-align: center;
    position: fixed;
    bottom: 70px;
    z-index: 9999;
    margin-bottom: constant(safe-area-inset-bottom);
    margin-bottom: env(safe-area-inset-bottom);
  }
  .exit-button {
    height: 2.0em;
    border-radius: 5px;
    opacity: 100%;
    background-color: white;
    font-size: 0.8em;
    font-weight: 400;
    letter-spacing: 1.2px;
    color: $dark-text;
    z-index: 999999;
  }
  .exit-button.activated {
    background-color: white;

  }
  .icon-exit-class {
    color: $dark-text;
  }

更新:進一步的研究表明,即使* ngIf也不起作用! 乞求看起來超級奇怪!

只需將ion-button指令添加到您的按鈕標簽,它將可以正常工作。

離子通過離子按鈕指令增加了一些增強。

<ion-content no-bounce>
  <div class="content_cover_exit">
    <button ion-button class="exit-button" (click)="logoutUser()">
      <ion-icon name="ios-exit-outline" class="icon-exit-class"></ion-icon>
      EXIT
    </button>
  </div>
</ion-content>

這樣嘗試

 <ion-content no-bounce>
      <div class="content_cover_exit">
       <button class="exit-button"(click)="exitApp()">
          <ion-icon name="ios-exit-outline" class="icon-exit-class"></ion-icon>
          EXIT
      <button>
      </div>
    </ion-content>

和你的

.ts

import {Platform} from 'ionic-angular';

export MyPage {


constructor(platform: Platform) {
    this.platform = platform;
  }
exitApp(){
 this.platform.exitApp();

}}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM