php怎样注释代码块,vscode怎样注释方法代码块

5934f0717b70aefcbabe053be5e580dc.png

Alt 在mac 是option键。

方法块的注释:

1、vscode 里安装插件 Document This

2、将光标放置于function上面,快捷键是 Ctrl+Alt+D 加 Ctrl+Alt+D/**

*网络请求

*

* @export

* @class HttpUtil

*/

export default class HttpUtil {

static get(url) {

return new Promise((resolve,reject)=>{

fetch(url)

.then(response=>response.json())

.then(result=>resolve(result))

.catch(erro=>reject(error))

})

}

}

多行注释:[alt+shift+A]/* export default class HttpUtil {

static get(url) {

return new Promise((resolve,reject)=>{

fetch(url)

.then(response=>response.json())

.then(result=>resolve(result))

.catch(erro=>reject(error))

})

}

} */

相关文章教程推荐:vscode教程