Reactjs 更新后,所有未看到的页面
今天,我将我的Reactjs 更新后,所有未看到的页面,reactjs,ionic-framework,Reactjs,Ionic Framework,今天,我将我的Ionic更新为最新版本,当我重新加载我的应用程序时,神奇地停止了工作,菜单确实起作用,但没有路由起作用,更不用说让我们看看选项卡了,我学习过,有一个类*离子页面不可见*,不知从何处出现,并且具有不透明度属性:0,尝试下载离子版本,但仍然不起作用,有什么想法吗 项目版本 Ionic: Ionic CLI : 5.4.9 (C:\Users\FOOX\AppData\Roaming\npm\node_modules\ionic) Ionic Framewor
Ionic
更新为最新版本,当我重新加载我的应用程序时,神奇地停止了工作,菜单
确实起作用,但没有路由
起作用,更不用说让我们看看选项卡了,我学习过,有一个类*离子页面不可见
*,不知从何处出现,并且具有不透明度属性:0
,尝试下载离子版本
,但仍然不起作用,有什么想法吗
项目版本
Ionic:
Ionic CLI : 5.4.9 (C:\Users\FOOX\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/react 4.11.7
Capacitor:
Capacitor CLI : 1.3.0
@capacitor/core : 1.3.0
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v10.16.3 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
页面示例
import React, { Component } from 'react';
import { IonButton, IonSlides, IonSlide, IonContent } from '@ionic/react';
import Agenda from './agenda.png';
import './Controller.css';
/**
* Para usar history dentro de un componente inteligente o del tipo class, se necesita:
* 1. Crear la clase
* 2. importar import { withRouter, RouteComponentProps } from 'react-router';
* 3. extenderla a React.Component y asociar a <RouteComponentProps>
* 4. al exportar la clase poner export default withRouter(nameComponent)
*/
class Controller extends Component{
render() {
return (
<IonPage>
<IonContent>
<IonSlides>
<IonSlide>
<img src={Agenda} alt="imageUno" className="imageSlides" />
</IonSlide>
<IonSlide>
Contactanos: 12312312312
email: asdads@assdassd.com
password: 12312312312
</IonSlide>
</IonSlides>
<IonButton expand="block" mode="ios" color="dark" routerDirection="forward" routerLink="/Login">
Ingresar
</IonButton>
<IonButton expand="block" mode="ios" color="dark" routerDirection="forward" routerLink="/LoginClient">
Ingresar como Cliente
</IonButton>
<IonButton expand="block" mode="ios" color="light" routerDirection="forward" routerLink="/CreateAccount">
Crear Cuenta
</IonButton>
<IonContent/>
</IonPage>
);
}
}
export default Controller;
import React,{Component}来自'React';
从'@ionic/react'导入{IonButton,IonSlides,IonSlide,IonContent};
从“/Agenda.png”导入议程;
导入“/Controller.css”;
/**
*必要时,联合国系统各组成部分的历史记录:
* 1. 克莱尔克拉斯酒店
* 2. 从“react router”导入{withRouter,RouteComponentProps};
* 3. a反应。成分y与a反应
* 4. al exportar la clase poner导出默认路由器(名称组件)
*/
类控制器扩展组件{
render(){
返回(
联系人:12312
电邮:asdads@assdassd.com
密码:12312
安格尔
安格尔科莫客户
克瑞尔昆塔
);
}
}
导出默认控制器;
更新->添加App.tsx和routes.tsx的代码
App.tsx(我放置路线的地方)
render(){
返回(
);
}
路线
导出默认类路由扩展React.Component{
render(){
返回(
(
这是我的道具
?
:
)} />
(
这是我的道具
?
:
)} />
(
这是我的道具
?
:
)} />
(
这是我的道具
?
:
)} />
(
这是我的道具
?
:
)} />
(
这是我的道具
?
:
)} />
(
这是我的道具
?
:
)} />
(
这是我的道具
?
:
)} />
{/*Ingreo de la cuenta del tipo客户*/}
(
这是我的道具
?
:
)} />
{/*RUTAS DE LOS CLIENTES*/}
(
这是我的道具
?
:
)} />
} />
);
}
}
需要查看更多代码吗?还有路由器代码是的,我上传了一个新的更新来查看更多的代码?还有路由器代码是的,我上传了一个新的更新
render() {
return (
<IonApp>
<IonReactRouter>
<Menu isLogged={this.state.isLoged} type={this.state.userData.type} />
<IonSplitPane contentId="main">
<Routes isLoged={this.state.isLoged} id={this.state.id} userData={this.state.userData} />
</IonSplitPane>
</IonReactRouter>
</IonApp>
);
}
export default class Routes extends React.Component<props>{
render() {
return (
<IonRouterOutlet id="main" contextMenu="main">
<Route exact path="/Controller" render={() => (
this.props.isLoged
? <Redirect to="/Home" />
: <Controller />
)} />
<Route exact path="/Login" render={() => (
this.props.isLoged
? <Redirect to="/Controller" />
: <Login />
)} />
<Route exact path="/CreateAccount" render={() => (
this.props.isLoged
? <Redirect to="/Home" />
: <CreateAccount />
)} />
<Route exact path="/Home" render={() => (
this.props.isLoged
? <Home id={this.props.id} type={this.props.userData.type} />
: <Redirect to="/Login" />
)} />
<Route exact path="/AdminCompanies" render={() => (
this.props.isLoged
? <AdminCompanies />
: <Redirect to="/Login" />
)} />
<Route exact path="/FinancialState" render={() => (
this.props.isLoged
? <ControllerUploadFiles id={this.props.id} targetDb="financial_state" title="Estados Financieros" />
: <Redirect to="/Login" />
)} />
<Route exact path="/Rut" render={() => (
this.props.isLoged
? <ControllerUploadFiles id={this.props.id} targetDb="register_unique_tribute" title="Registro Unico Tributario" />
: <Redirect to="/Login" />
)} />
<Route exact path="/Settings" render={() => (
this.props.isLoged
? <Settings id={this.props.id} accountData={this.props.userData} />
: <Redirect to="/Login" />
)} />
{/* Ingreso de la cuenta del tipo cliente */}
<Route exact path="/LoginClient" render={() => (
this.props.isLoged
? <Redirect to="/Controller" />
: <LoginClient />
)} />
{/* RUTAS DE LOS CLIENTES */}
<Route exact path="/MyAccountans" render={() => (
this.props.isLoged
? <Redirect to="/Home" />
: <MyAccountants id={this.props.id} />
)} />
<Route path="/" render={() => <Redirect to="/Controller" />} />
</IonRouterOutlet>
);
}
}