ionic4 (angular) generation browser platform (webApp) does not update the page in mobile QQ browser

Develop a webapp project with ionic4, on the mobile QQ find the problem page does not update the test. Data is changed, there is no update on the page.

My code using a getter method, calculated to achieve similar properties of vue. Normal, on the mobile QQ browser, when data is modified, the getter method does not automatically triggered in other browsers and micro-channel browser, and then I changed down without getter method, into a private method, manual call is still the same.

@Input 

get xxx() {} 
Finally, a solution found on the Internet, https://www.jianshu.com/p/714e709b19ef
import { Component, ChangeDetectorRef } from '@angular/core';

export class HomePage {
  constructor(
    private changeDetectorRef: ChangeDetectorRef,
    ...
  ) { }
    
    ...
    this.changeDetectorRef.detectChanges();
    ...
}

 

Guess you like

Origin www.cnblogs.com/johnjackson/p/12454277.html