父组件类
- export class Parent {
- show: boolean = false;
- constructor() { }
- showChild() {
- this.show = true;
- }
- }
父组件模板
- <child [isShow]="show"></child>
子组件类
- export class Child {
- @Input isShow: boolean = false;
- constructor() { }
- onClick() {
- this.isShow = false;
- }
- }
在我触发子组件中的onClick()后,showChild()无法显示子组件.
为什么?