mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(): deprecate web component controllers (#19109)
This commit is contained in:
@@ -30,8 +30,6 @@
|
||||
<ion-button id="backdrop-loading" expand="block" onclick="presentLoadingWithOptions({backdropDismiss: true})">Show Backdrop Click Loading</ion-button>
|
||||
<ion-button id="html-content-loading" expand="block" onclick="presentLoadingWithOptions({cssClass: 'html-loading', duration: 5000, message: '<ion-button>Click impatiently to load faster</ion-button>'})">Show Loading with HTML content</ion-button>
|
||||
|
||||
<ion-loading-controller></ion-loading-controller>
|
||||
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col size="6">
|
||||
@@ -64,19 +62,19 @@
|
||||
|
||||
</ion-app>
|
||||
<script>
|
||||
async function presentLoading() {
|
||||
const loadingController = document.querySelector('ion-loading-controller');
|
||||
const loadingElement = await loadingController.create({
|
||||
function presentLoading() {
|
||||
const loadingElement = Object.assign(document.createElement('ion-loading'), {
|
||||
message: 'Hellooo',
|
||||
duration: 2000
|
||||
});
|
||||
return await loadingElement.present();
|
||||
document.body.appendChild(loadingElement);
|
||||
return loadingElement.present();
|
||||
}
|
||||
|
||||
async function presentLoadingWithOptions(opts) {
|
||||
const loadingController = document.querySelector('ion-loading-controller');
|
||||
const loadingElement = await loadingController.create(opts);
|
||||
return await loadingElement.present();
|
||||
function presentLoadingWithOptions(opts) {
|
||||
const loadingElement = Object.assign(document.createElement('ion-loading'), opts);
|
||||
document.body.appendChild(loadingElement);
|
||||
return loadingElement.present();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
<button id="translucent-loading" onclick="presentLoadingWithOptions({duration: 5000, content: 'Loading Please Wait...', translucent: true})">Show Loading with translucent</button>
|
||||
<button id="custom-class-loading" onclick="presentLoadingWithOptions({duration: 5000, content: 'Loading Please Wait...', translucent: true, cssClass: 'custom-class custom-loading'})">Show Loading with cssClass</button>
|
||||
|
||||
<ion-loading-controller></ion-loading-controller>
|
||||
|
||||
<style>
|
||||
body > button {
|
||||
display: block;
|
||||
@@ -36,18 +34,18 @@
|
||||
|
||||
<script>
|
||||
async function presentLoading() {
|
||||
const loadingController = document.querySelector('ion-loading-controller');
|
||||
const loadingElement = await loadingController.create({
|
||||
const loadingElement = Object.assign(document.createElement('ion-loading'), {
|
||||
message: 'Hellooo',
|
||||
duration: 5000
|
||||
});
|
||||
return await loadingElement.present();
|
||||
document.body.appendChild(loadingElement);
|
||||
return loadingElement.present();
|
||||
}
|
||||
|
||||
async function presentLoadingWithOptions(opts) {
|
||||
const loadingController = document.querySelector('ion-loading-controller');
|
||||
const loadingElement = await loadingController.create(opts);
|
||||
return await loadingElement.present();
|
||||
function presentLoadingWithOptions(opts) {
|
||||
const loadingElement = Object.assign(document.createElement('ion-loading'), opts);
|
||||
document.body.appendChild(loadingElement);
|
||||
return loadingElement.present();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user