preact-nativescript-components
by hizoul | v0.0.7-2
为 NativeScript 提供的 preact 组件
npm i --save preact-nativescript-components

preact-nativescript-components构建状态 覆盖率状态 依赖 npm

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>
)
}
})

可导入组件列表