我有一个父组件和一个子组件。父组件可以如下所示:
<button (click)="popupState = true>Click this to get a popup</button>
<popup-component [popupState]="popupState"></popup-component>
在ts文件中包含:
import { Component, OnInit} from '@angular/core';
@Component({
selector: 'parent-
当我尝试使用@click指令更改某个属性的值时,会收到此警告:
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "name"
我的代码如下:
<html>
<head>
<ti