mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00

* Enable chrome-devtools elemets tab * Trigger updates when property is chaned form native * Tslint fixes * Don't run dom-elemet tests in IOS * fix tests * Create package.json * Update package.json * domNode changed to field for performance
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();
|
|
|
|
} |