onelaraveljs 1.21.13 → 1.21.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -101,7 +101,7 @@ export class ReactiveComponent {
|
|
|
101
101
|
* Mount component và thiết lập state subscriptions
|
|
102
102
|
*/
|
|
103
103
|
mounted() {
|
|
104
|
-
if (this.isMounted
|
|
104
|
+
if (this.isMounted) return;
|
|
105
105
|
|
|
106
106
|
// console.log(`ReactiveComponent mounted [${this.type}]:`, this.id);
|
|
107
107
|
|
|
@@ -130,11 +130,12 @@ export class ReactiveComponent {
|
|
|
130
130
|
* Unmount component và dọn dẹp subscriptions
|
|
131
131
|
*/
|
|
132
132
|
unmounted() {
|
|
133
|
-
if (!this.isMounted
|
|
133
|
+
if (!this.isMounted) return;
|
|
134
134
|
|
|
135
135
|
// console.log(`ReactiveComponent unmounted [${this.type}]:`, this.id);
|
|
136
136
|
|
|
137
137
|
this.isMounted = false;
|
|
138
|
+
this.isScanned = false;
|
|
138
139
|
|
|
139
140
|
// Unmount children cho loại watch
|
|
140
141
|
if (this.type === 'watch') {
|
|
@@ -142,13 +143,14 @@ export class ReactiveComponent {
|
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
this._unsubscribeAll();
|
|
146
|
+
this.markup = null;
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
/**
|
|
148
150
|
* Cập nhật component khi state thay đổi
|
|
149
151
|
*/
|
|
150
152
|
update() {
|
|
151
|
-
if (this._isUpdating || !this.isMounted
|
|
153
|
+
if (this._isUpdating || !this.isMounted) return;
|
|
152
154
|
|
|
153
155
|
this._isUpdating = true;
|
|
154
156
|
|