解决方案:
import { ViewChild } from '@angular/core';
import {Segment } from 'ionic-angular';
export class FloorsPage {
@ViewChild(Segment) segment: Segment;
}
在数据请求之后添加:
setTimeout(() => {
if (this.segment) {
this.segment.ngAfterContentInit();
}
}, 100);
参考:https://blog.csdn.net/qq_39252703/article/details/81703233
网友评论