npm i --save preact-nativescript-components
- 版本:0.0.7-2
- GitHub:
- NPM: https://npmjs.net.cn/package/preact-nativescript-components
- 下载
- 昨天: 0
- 上周: 0
- 上个月: 0
preact-nativescript-components

preact-nativescript-components 旨在使用 JSX 语法为 preact-to-nativescript 组件提供支持
使用方法
您应该可以按名称导入并使用 NativeScript UI 组件,例如。
import application from "tns-core-modules/application"
import { render } from "preact-to-nativescript"
import {
ActionBar, ActionItem, Button, Label, Page, ScrollView, StackLayout
} from "preact-nativescript-components"
application.start({
create: () => {
return render(
<Page>
<ActionBar>
<StackLayout>
<Label>Custom Header</Label>
</StackLayout>
<ActionItem text="act" />
</ActionBar>
<StackLayout>
<Label>PageContent</Label>
<Button text="Button" />
</StackLayout>
</Page>
)
}
})