在JavaScript中有类似于C#区域的东西吗? Visual Studio 2017 [英] Is there something similar to C# regions in JavaScript? Visual Studio 2017

查看:74
本文介绍了在JavaScript中有类似于C#区域的东西吗? Visual Studio 2017的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为那些希望将他们的JavaScript库组织成类别的人工作:CRUD函数,表单函数等。他们非常喜欢C#中的区域实用程序,并且在他们的JavaScript文件中要求这样做。有什么建议?我正在使用Visual Studio 2017和Team Foundation Server。

I am doing work for somebody who would like their JavaScript library organized into categories: CRUD functions, Form functions, etc. They really like the utility of regions in C# and are asking for this in their JavaScript file. Any suggestions? I am using Visual Studio 2017 and Team Foundation Server.

推荐答案

选择要压缩的代码。按Ctrl + M + H.该代码现在可以折叠。为了便于阅读,请在区域上方注释,以便为其命名。

Select the code you want to compress. Press Ctrl + M + H. That code will now be collapsible. For readability, comment above the "region" to give it a name.

来源: http://blog.degree.no/2013/05/define-a-region-in- javascript-files-visual-studio-2010-2012 /

这篇关于在JavaScript中有类似于C#区域的东西吗? Visual Studio 2017的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆