npm i --save ngRx-devtools-nativescript-next
- 版本:0.5.0
- GitHub: https://github.com/vakrilov/ngrx-devtools-nativescript
- NPM: https://npmjs.net.cn/package/ngrx-devtools-nativescript-next
- 下载
- 昨日:0
- 上周:0
- 上月:0
##ngRx-devtools-nativescript 对@ngrx/store-devtools中的开发工具监控器的NativeScript实现。
使用方法
首先,您应该使用 StoreModule.provideStore(...)
仪表化您的 @ngrx/store。查看 @ngrx/devtools readme 了解如何操作。
在您的应用程序(或其他)模块中导入 NativeScriptDevToolsMonitors
,并通过导入 StoreDevtoolsModule.instrumentStore()
添加 store-dev-tools 仪表化。
import { NgModule } from "@angular/core";
import { StoreModule } from '@ngrx/store';
import { NativeScriptDevToolsMonitors } from "ngrx-devtools-nativescript";
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
@NgModule({
imports: [
NativeScriptModule,
NativeScriptDevToolsMonitors,
StoreModule.provideStore({ ... }),
StoreDevtoolsModule.instrumentStore()
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
class AppModule { };
在您的应用程序中(最好在视觉树的根处)使用 <ns-dock-monitor>
组件。
import { NSDockMonitor } from "ngrx-devtools-nativescript";
@Component({
selector: "my-app",
directives: [NSDockMonitor],
template: `
<grid-layout>
//...
<ns-dock-monitor screenCover="0.5"></ns-dock-monitor>
</grid-layout>`
})
export class AppComponent {
//...
}
您可以使用 screenCover
属性指定屏幕的哪个部分应由开发工具滑出窗口覆盖。
示例
示例项目