小编Emi*_*lla的帖子

在createMaterialTopTabNavigator中使用navigation.navigate

我开始使用react-native,我正在尝试创建一个"hello word"应用程序来查看它是如何工作的.我在屏幕顶部制作了一个带有"标签"的菜单

在app.js中我添加了createStackNavigator来设置我的路由 App.js

import { ... }
const AppNavigator = createStackNavigator({     
    Main: { screen: Main},
    CScreen: {screen: FormCScreen},
});

type Props = {};
export default class App extends Component<Props> {
render() {
    return (
        <AppNavigator />    
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

这是我的屏幕,我在其中设置标签.

Main.js

imports {AScreen, BScreen} ...
const Tab = createMaterialTopTabNavigator(
{
   A: AScreen,
   B: BScreen,
},
{
  tabBarPosition: 'top',

});

export default class Main extends Component {

render() {
    return (  
      <Tab/>
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

BScreen.js

现在在我的一个BScreen选项卡上,我想点击一个按钮,我希望它加载屏幕(CScreen)

imports …
Run Code Online (Sandbox Code Playgroud)

javascript react-router react-native react-navigation

7
推荐指数
1
解决办法
2736
查看次数

构建角度应用程序并安装在服务器上

我正在开发angular6应用程序,我想生成一个要在我的服务器上进行测试的构建,当前我使用的是ng服务器,它在我的浏览器上运行时不会产生任何错误。

c:\ Users \ emiry \ Desktop \ Angular \ Projects \ StartingNewProject

当我运行ng build命令时,它将为/ dist文件夹生成一个版本,并且不返回任何错误

在我已经安装的机器上,wamp64所以我得到了ng生成的构建并将其放在我的www文件夹中

C:\ wamp64 \ www \ StartingNewProject

仅仅是这足以让我能够在服务器上运行我的应用程序?

当我尝试通过http:// localhost / startingnewproject /访问服务器上的应用程序时

它在浏览器控制台中向我返回以下错误

无法加载资源:服务器以404(未找到)状态响应polyfills.js:1无法加载资源:服务器以404(未找到)状态进行响应styles.js:1无法加载资源:服务器响应状态为404(未找到)vendor.js:1无法加载资源:服务器响应状态为404(未找到)main.js:1无法加载资源:服务器响应的状态为: 404(未找到)

angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "StartingNewProject": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {},
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/StartingNewProject",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets" …
Run Code Online (Sandbox Code Playgroud)

build angular ng-build angular6

5
推荐指数
2
解决办法
5038
查看次数

在php中检索邮递员提交的json

我正在使用 php 创建一个 api,我正在使用邮递员来测试我的请求。

在邮递员中,我选择发布方法,在正文中使用原始数据将 json 发送到我的 api

category{
    "id":"1",
    "desc": "testing",
    "observation": "testing",
}
Run Code Online (Sandbox Code Playgroud)

它发送完美,但我怎样才能在服务器端恢复我的json?在我的 php

我正在使用

$result = json_decode($_POST['category'], true);
Run Code Online (Sandbox Code Playgroud)

但错误发生

 Notice: Undefined index: category in
Run Code Online (Sandbox Code Playgroud)

邮差

php api postman

0
推荐指数
1
解决办法
5966
查看次数

在多个屏幕上打开领域时反应本机错误

我有一个关于在反应本机中创建和使用领域数据库的问题。

我有两个屏幕,负责执行crud、category.js和client.js等操作

category.js中我有以下构造函数

constructor(props) {
    super(props);
    realm = new Realm({
        schema: [{ name: 'category', primaryKey: 'id', properties: { id: 'int', descricao: 'string', status: 'bool' } }]
    })
}
Run Code Online (Sandbox Code Playgroud)

cliente.js中我有

constructor(props) {
    super(props);
    realm = new Realm({
        schema: [{ name: 'client', primaryKey: 'id', properties: { id: 'int', nome: 'string', cpf: 'string', celular: 'string', status: 'bool' } }]
    })
}
Run Code Online (Sandbox Code Playgroud)

现在我有以下疑问。

对于这个模式,我是否有一个包含表类别和客户端的数据库?

当我在 client.js 屏幕上并且想要转到 Category.js 时,我收到以下错误通知:已在具有不同架构的当前线程上打开。

如何关闭或打开连接,以便我可以在两个屏幕上使用该领域?

realm reactjs react-native

0
推荐指数
1
解决办法
1777
查看次数