update demo

This commit is contained in:
pengfei.zhou
2020-09-05 12:41:12 +08:00
committed by osborn
parent a5ca58c38a
commit fc6b465b92
3 changed files with 28 additions and 16 deletions

View File

@@ -17,7 +17,7 @@ import {
import { title, label, colors } from "./utils";
@Entry
class PopoverDemo extends Panel {
export class PopoverDemo extends Panel {
build(rootView: Group): void {
scroller(
vlayout([
@@ -52,7 +52,7 @@ class PopoverDemo extends Panel {
textColor: Color.WHITE,
layoutConfig: layoutConfig().just(),
onClick: () => {
popover(context).show(
popover(this.context).show(
stack(
[
text({
@@ -69,9 +69,9 @@ class PopoverDemo extends Panel {
v.onClick = () => {
v.backgroundColor = colors[++idx % colors.length];
};
modal(context).toast("Dismissed after 3 seconds");
modal(this.context).toast("Dismissed after 3 seconds");
setTimeout(() => {
popover(context).dismiss();
popover(this.context).dismiss();
}, 3000);
}),
],