mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00

* chore(tslint): fix tslint config & errors * chore(tslint): enable double quotes, whitespace, and arrow-return-shorthand rules and fix errors
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import * as frame from "tns-core-modules/ui/frame";
|
|
import { Label } from "tns-core-modules/ui/label";
|
|
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
|
|
// import { DOMNode } from "tns-core-modules/debugger/dom-node";
|
|
|
|
export function print(args) {
|
|
// const node = new DOMNode(frame.topmost());
|
|
// console.dir(node.toJSON());
|
|
|
|
// const btn = args.object.page.getViewById("btn");
|
|
// btn.ensureDomNode();
|
|
// console.dir(btn.domNode.getComputedProperties());
|
|
}
|
|
|
|
let i = 0;
|
|
export function add(args) {
|
|
const container = args.object.page.getViewById("container");
|
|
const lbl = new Label();
|
|
lbl.text = "label " + i++;
|
|
container.addChild(lbl);
|
|
}
|
|
|
|
export function remove(args) {
|
|
const container = <StackLayout>args.object.page.getViewById("container");
|
|
const lbl = container.getChildAt(container.getChildrenCount() - 1);
|
|
container.removeChild(lbl);
|
|
}
|
|
|
|
export function navigate() {
|
|
frame.topmost().navigate("gallery-app/main-page");
|
|
}
|
|
|
|
export function change(args) {
|
|
args.object.text = "hi " + Math.random();
|
|
|
|
} |