Код: Выделить всё
child1
Код: Выделить всё
child2
Вы можете увидеть, что я попробовал ниже, после кода
pparent.html
Код: Выделить всё
{showModal}
< /code>
pparent.js
_showModal;
set showModal(value) {
this._showModal = value || false;
}
get showModal() {
return this._showModal;
}
saveEvent(event) {
this.showModal = {...this.showModal, Boolean:true};
// other things I've tried...
/*
this.showModal = true;
this.showModal = Object.assign({}, true);
in combination with this.showModal = true;...
this.dispatchEvent(new RefreshEvent());
*/
}
< /code>
child1.html
{showModal}
< /code>
child1.js
_showModal;
@api
set showModal(value) {
this._showModal = value || false;
}
get showModal() {
return this._showModal;
}
< /code>
child2.html
{showModal}
Hi, I'm a modal
< /code>
child2.js
_showModal;
@api
set showModal(value) {
this._showModal = value || false;
}
get showModal() {
return this._showModal;
}
- Иметь значения на child1 & child2 be @api s без getters и setters
- waiftmodal on parent attrack
Подробнее здесь: https://stackoverflow.com/questions/795 ... -component