ionic如何在彈框寫HTML

2021-09-27 08:39:03 字數 1841 閱讀 4403

首先我們先學習下如何跳**

//  此方法中寫了幾個引數,則對應下面方法需要幾個引數,我們在html調取此方法(exitsystem)即可使用

exitsystem()

// 此方法對應上面的引數

async

presentalertexitsystem

( alertcontroller: alertcontroller,

message: string,

router?

: router,

url?

: string

)

我們只做彈框,需要反斜槓來實現:

/**

* @description: 跳轉兌換頁

* @param 無

* @return: 無

* @author: 張三

*/exitsystem()

async

presentalertexitsystem

( alertcontroller: alertcontroller,

message: string,

router?

: router,

url?

: string

)else}}

]});

}

css樣式

/deep/ .tankuang

/deep/ .alert-button-group

/deep/ .alert-button-inner

}

效果如下:

當前我們在ts裡面畫的頁面是執行不了事件或者繫結的,只能是渲染頁面,我們在這裡再次執行click事件,請看我們在最後新增的方法

import

from

'@angular/core'

;// 宣告元件

constructor

(public renderer2: renderer2

)exitsystem()

async

presentalertexitsystem

( alertcontroller: alertcontroller,

message: string,

router?

: router,

url?

: string

)else}}

]});

await alert.

present()

;this

.div = document.

getelementbyid

('alert-1-msg');

// 獲取要執行的click中的id

this

.renderer2.

listen

(this

.div,

'click',(

)=>);

}

注意:彈框中是 用來顯示的 ,所有我們可以新增,寫事件只能寫到button裡面 ,或者像我們這樣獲取id再次執行也可以,但是要想資料繫結的話暫時是實現 不了的!

ionic 自定義彈框

在工作過程中往往需要自定義的彈框。因此,將內容整理如下,以方便學習。若有不當之處,敬請斧正!思路 ionicpopup.show div class form content class input name input1 div class input area type number place...

IONIC遮罩層及自定義彈框

先看效果圖 當我們在使用自定義彈框後,需要乙個背景遮罩層。下面是實現方法 html頁面 about onebtn 您的餘額不足,請及時充值!取消確定 css 樣式是關鍵 ion row twob ialog div btn div last child shade ts import from an...

ionic3彈框自定義樣式

border radius 5px important 這句就是重點,讓邊框變為圓角 border 1px solid ccc important 讓邊框變為1px寬度,直線,ccc顏色 使用ionic封裝的元件時,也對元件封裝好了樣式,如果想要改樣式需要同樣的class名字進行修改。在同樣的名字下...