tianyun 10 kuukautta sitten
vanhempi
commit
28b55399cf
2 muutettua tiedostoa jossa 7 lisäystä ja 28 poistoa
  1. 2 1
      simple-demo/send_memos.html
  2. 5 27
      tmp.js

+ 2 - 1
simple-demo/send_memos.html

@@ -443,7 +443,8 @@
             archive(item) {
                 requestUtil.async(`https://web_history.tianyunperfect.cn/memos/archive`, 'post', {id: item.id}, {}).then(res => {
                     this.msg('归档成功');
-                    this.search();
+                    // 本地缓存更新
+                    this.contentList = this.contentList.filter(it => it.id !== item.id);
                 });
             },
             handleClose(done) {

+ 5 - 27
tmp.js

@@ -1,28 +1,6 @@
-// 查找 aria-label="Edit" 的btn
+let a = 1;
+let b = 'abc ${a}';
+// 让b里的a填充,通过b变量和a变量
+b = eval('`' + b + '`');
 
-
-// 监控 键盘 事件,如果触发了e
-document.addEventListener('keydown', e => {
-    // 如果按下了esc键
-    if (e.key === 'e') {
-        const btn = document.querySelector('button[aria-label="Edit"]')
-        const dialog = document.querySelector('.dialog-wrapper.memo-editor-dialog.showup')
-        // 如果btn存在,但是dialog不存在
-        if (btn && !dialog) {
-            // 点击btn
-            btn.click();
-            e.preventDefault();
-        }
-    }
-})
-
-
-function dispatchEventClick(cssSelector) {
-    let dom = document.querySelector(cssSelector);
-    if (!dom) {
-        console.log('dom is null');
-        return;
-    }
-    const event = new Event('click');
-    dom.dispatchEvent(event);
-}
+console.log(b); // 输出: abc 1