龙风
龙风
macOs 第一步:安装 pyenv ```bash brew install pyenv ``` 第二步:配置环境 ~/.bash_profile ```bash if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)" fi ``` 第三步:更新配置 ```bash source ~/.bash_profile ``` 第四步:下载所需要的版本...
最近有在调整流水线,打包路径在window上,不得不来补下window命令 ```bash dir # 列出目录 dir 路径 # 路径下的目录 dir *.png # 过滤 ``
**host 管理工具** [window下载地址](https://github.com/oldj/SwitchHosts/releases/download/v4.2.0-beta/SwitchHosts_windows_installer_x64_4.2.0.6105.exe) [MAC ARM下载地址](https://github.com/oldj/SwitchHosts/releases/download/v4.2.0-beta/SwitchHosts_mac_arm64_4.2.0.6105.dmg) [MAC inter 下载地址](https://github.com/oldj/SwitchHosts/releases/download/v4.2.0-beta/SwitchHosts_mac_x64_4.2.0.6105.dmg)
在事件处理程序中,事件会从被点击的元素开始,向上冒泡到它的父元素,直到冒泡到文档根元素。如果您在父元素上也绑定了相同的事件处理程序,那么它也会被触发。 `event.stopPropagation()` 和 `event.stopImmediatePropagation()` 方法都是用来阻止事件冒泡的。它们的区别在于,`event.stopPropagation()` 方法只能阻止事件冒泡,而 `event.stopImmediatePropagation()` 方法不仅可以阻止事件冒泡,还可以阻止同一元素上绑定的其他事件处理程序的执行。 具体来说,`event.stopPropagation()` 方法会阻止事件继续冒泡到父元素,但是同一元素上绑定的其他事件处理程序仍然会被执行。而 `event.stopImmediatePropagation()` 方法则会立即停止事件的传播,并且不会执行同一元素上绑定的其他事件处理程序。 在上面的代码中,我们在事件处理程序中使用了 `event.stopPropagation()` 和 `event.stopImmediatePropagation()` 方法来阻止事件冒泡和立即停止事件传播。这样,当用户点击元素时,事件不会冒泡到父元素,并且同一元素上绑定的其他事件处理程序也不会被执行。 ```vue import { defineComponent, h } from 'vue'; import { Button } from...
轮询方案 ``` function poll() { setTimeout(() => { // 发送轮询请求 fetch('http://example.com/api') .then(response => { if (response.status === 200) { // 轮询成功,处理数据 return response.json(); } else { // 轮询失败,继续轮询 return poll();...
问题1 : For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves 报错: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure...
**command 可以执行的 py, js 、直接可被执行的bin** ```js const { exec } = require("child_process"); const p = new Promise((r) => { const command = "node my-script.js"; exec(command, (error, stdout, stderr) => {...
如何将一个图片快速的保存/下载到本地,不是打开一个新的链接 ```md ?response-content-disposition=attachment # 图片地址做一个拼接 ``` ```js export const openATagToDownloadUrl = (url) => { const a = document.createElement('a'); a.download = fileName; a.href = url + '?response-content-disposition=attachment'; document.body.appendChild(a); a.click(); document.body.removeChild(a); };...