update at 2026-03-04 13:25:26
This commit is contained in:
11
pxterm/scripts/archive/cjs_tools/patch_prevent_default.cjs
Normal file
11
pxterm/scripts/archive/cjs_tools/patch_prevent_default.cjs
Normal file
@@ -0,0 +1,11 @@
|
||||
const fs = require('fs');
|
||||
let code = fs.readFileSync('src/components/TerminalPanel.vue', 'utf8');
|
||||
|
||||
// Inside touchmove, add e.preventDefault() if it is cancelable
|
||||
code = code.replace(/event\.stopImmediatePropagation\(\);/g,
|
||||
`event.stopImmediatePropagation();
|
||||
if (event.cancelable) {
|
||||
event.preventDefault(); // 我们使用 JS 控制滚动,必须禁止系统原生滚动争抢
|
||||
}`);
|
||||
|
||||
fs.writeFileSync('src/components/TerminalPanel.vue', code);
|
||||
Reference in New Issue
Block a user