ionic4 页面跳转传值和新页面取值
程序员文章站
2022-06-23 14:43:47
页面跳转 : 新页面取值: import { ......
页面跳转 :
<ion-row *ngfor="let item of aboutdata.stockdata"
[routerlink]="[ '/stock-details']" /* 跳转页面*/
[queryparams]="item" /* 传的参数*/>
新页面取值:
import { component, oninit } from '@angular/core';
import {activatedroute} from "@angular/router"; /* 引入控件*/
@component({
selector: 'app-stock-details',
templateurl: './stock-details.page.html',
styleurls: ['./stock-details.page.scss'],
})
export class stockdetailspage implements oninit {
sparams:any={};
constructor(public _activerouter: activatedroute) {
this._activerouter.queryparams.subscribe(params=> {
console.log(params);
this.sparams=params;
console.log(this.sparams.symbol);
})
}
ngoninit() {
}
}
上一篇: 抖音时长限制要求(抖音直播时长奖励规则)
下一篇: 抖音、互联网的赚钱公式:人=流量=钱