在html中自动填充的代码是,VSCode插件制作:HTML代码自动填充

Visual Studio Code不但跨平台,还有良好的扩展性。我们可以在Visual Studio Marketplace上找到各种各样的插件。这里分享下怎样制作一个简单的用于代码填充的插件。

自定义代码片段

键盘快捷键Ctr+Shift+P搜索关键字snippet:

5eab9a560a1b6cd04c949b702bb7491f.png

选择HTML:

f23d965e8011851d6afeef7bdbf7afdf.png

这个时候在C:\Users\\AppData\Roaming\Code\User\snippets下会自动创建一个html.json的模版文件:

94ca37ebb3e68328d5015c9fe071103f.png

现在可以在里面写一点东西了。这里是Dynamic Web TWAIN的代码:

{

"include": {

"prefix": "dwt include",

"body": [

""

],

"description": "Include Dynamic Web TWAIN JavaScript library."

},

"scan module": {

"prefix": "dwt scan module",

"body": [

"",

"

"

"function AcquireImage() {",

"\tvar DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');",

"\tDWObject.IfDisableSourceAfterAcquire = true;",

"\tvar bSelected = DWObject.SelectSource(); \n",

"\tif(bSelected) {",

"\t\tvar OnAcquireImageSuccess, OnAcquireImageFailure;",

"\t\tOnAcquireImageSuccess = OnAcquireImageFailure = function () {",

"\t\tDWObject.CloseSource();",

"\t};\n",

"\tDWObject.OpenSource();",

"\tDWObject.AcquireImage(OnAcquireImageSuccess, OnAcquireImageFailure); ",

"\t}",

"}",

""

],

"description": "A simple web scanning module."

},

"full sample": {

"prefix": "dwt full sample",

"body": [

"\n

\n\tHello World",

"\t\n\n\n

",

"\t",

"\t

"\t

"\tfunction AcquireImage() {",

"\t\tvar DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');",

"\t\tDWObject.IfDisableSourceAfterAcquire = true;",

"\t\tvar bSelected = DWObject.SelectSource(); \n",

"\t\tif(bSelected) {",

"\t\t\tvar OnAcquireImageSuccess, OnAcquireImageFailure;",

"\t\t\tOnAcquireImageSuccess = OnAcquireImageFailure = function () {",

"\t\t\tDWObject.CloseSource();",

"\t\t};\n",

"\t\tDWObject.OpenSource();",

"\t\tDWObject.AcquireImage(OnAcquireImageSuccess, OnAcquireImageFailure); ",

"\t\t}",

"\t}",

"\t\n\n

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值