-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
384 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component } from '@lifeart/gxt'; | ||
|
||
export default class Fallback extends Component { | ||
<template> | ||
<div class='inline-flex flex-col items-center'> | ||
<div | ||
class='w-28 h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full animate-pulse mt-2 mb-1' | ||
></div> | ||
</div> | ||
</template> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { context } from '@/utils/context'; | ||
import { SUSPENSE_CONTEXT } from '@/utils/suspense'; | ||
import { Component } from '@lifeart/gxt'; | ||
|
||
export default class LoadMeAsync extends Component<{ | ||
Args: { name: string }; | ||
}> { | ||
constructor() { | ||
// @ts-ignore | ||
super(...arguments); | ||
console.log('LoadMeAsync created'); | ||
this.suspense?.start(); | ||
} | ||
@context(SUSPENSE_CONTEXT) suspense!: { | ||
start: () => void; | ||
end: () => void; | ||
}; | ||
loadData = (_: HTMLElement) => { | ||
setTimeout(() => { | ||
this.suspense?.end(); | ||
console.log('Data loaded'); | ||
}, 2000); | ||
}; | ||
<template> | ||
{{log 'loadMeAsync rendered'}} | ||
<div {{this.loadData}} class='inline-flex flex-col items-center'>Async | ||
component "{{@name}}"</div> | ||
</template> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.