创建两个页面相互转换
·
一、构建第一个页面
1.在项目结构中找到home/entry/src/main/ets/pages
2.右击pages新建一个arkts文件,命名为Index.ets
![]()
3.在Index.ets中编写第一个页面的代码


二、构建第二个页面
1.在项目结构中找到home/entry/src/main/ets/pages
2.右击pages新建一个arkts文件,命名为second.ets
![]()
3.在second.ets中编写第一个页面的代码


三、配置路由
1.打开![]()
2.输入代码

四、运行测试
1.运行设备管理器里的设备
2.点击右上角的运行按钮(绿色三角)


更多推荐


所有评论(0)