This commit is contained in:
2025-09-14 00:21:54 +08:00
commit d40b3bbd62
766 changed files with 36275 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
Page({
onShareAppMessage() {
return {
title: 'memory-warn',
path: 'package/API/pages/memory-warn/memory-warn',
};
},
data: {
value: '',
memory: [],
},
resetValue() {
this.setData({ value: '' });
},
bindSubscribe() {
this.resetValue();
xhs.onMemoryWarning(e => {
this.setData({ value: JSON.stringify(e) });
});
this.setData({ value: '订阅成功' });
},
bindUnSubscribe() {
this.resetValue();
xhs.offMemoryWarning(() => {
this.setData({ value: '取消成功' });
});
},
bindMemory() {
if (this.handle) {
clearInterval(this.handle);
} else {
this.handle = setInterval(() => {
const { memory } = this.data;
for (let i = 0; i < 100; i++) {
memory.push({ name: 'test', age: 20 });
}
this.setData({ memory });
}, 1000);
}
},
});