mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: demo input handilng
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<Button text="box-shadow" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo" />
|
||||
<Button text="css-playground" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo" />
|
||||
<Button text="datepicker" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo" />
|
||||
<Button text="forms" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo" />
|
||||
<Button text="image-async" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo" />
|
||||
<Button text="image-handling" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo" />
|
||||
<Button text="labels" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo" />
|
||||
|
||||
14
apps/toolbox/src/pages/forms.ts
Normal file
14
apps/toolbox/src/pages/forms.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Page, Observable, EventData } from '@nativescript/core';
|
||||
|
||||
let page: Page;
|
||||
|
||||
export function navigatingTo(args: EventData) {
|
||||
page = <Page>args.object;
|
||||
page.bindingContext = new SampleData();
|
||||
}
|
||||
|
||||
export class SampleData extends Observable {
|
||||
textChange(args) {
|
||||
console.log('textChange:', args.object.text);
|
||||
}
|
||||
}
|
||||
17
apps/toolbox/src/pages/forms.xml
Normal file
17
apps/toolbox/src/pages/forms.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
|
||||
<Page.actionBar>
|
||||
<ActionBar title="Forms" class="action-bar">
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
<StackLayout padding="20">
|
||||
<GridLayout rows="auto,auto" columns="auto,*">
|
||||
<Label text="TextField" />
|
||||
<TextField row="1" textChange="{{textChange}}" marginTop="10" />
|
||||
</GridLayout>
|
||||
|
||||
<GridLayout rows="auto,auto" columns="auto,*" marginTop="20">
|
||||
<Label text="TextField" secure="true" />
|
||||
<TextField row="1" textChange="{{textChange}}" marginTop="10" />
|
||||
</GridLayout>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user