IndexPage 定义一个参数类 export class RouterParams { src:string constructor(str:string) { this.src = str } } 点击按钮后,将创建的RouterParams 对象传递到第二页 Button($r('app.string.next')) .fontSize(16) .width(300) .height(50) .backgroundColor($r('app.color.button_bg')