创建页面

页面跳转

页面栈

路由模式

跳转传参

简易示例
页面配置
{
"src": [
"pages/Index",
"pages/Page1",
"pages/Page1_2",
"pages/Page1_1",
"pages/Page1_1_1"
]
}
页面_登录
import {
router } from '@kit.ArkUI'
interface dl{
zh:string,mm:string}
@Entry
@Component struct Index {
@State user : dl = {
zh:'',mm:''}
build() {
Column(){
TextInput({
placeholder:`请输入用户 账号`,text:this.user.zh})
.onChange((txt:string)=>{
this.user.zh = txt})
TextInput({
placeholder:`请输入用户 密码`,text:this.user.mm})
.onChange((txt:string)=>{
this.user.mm = txt})
.type(InputType.Password)
Text('登录')
.fontSize(40)
.onClick(()=>{
router.replaceUrl({
url:'pages/Page1'