• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

snippets: 这个仓库记录vscode插件 A-super-snippets

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

snippets

开源软件地址:

https://gitee.com/qq34347476/snippets

开源软件介绍:

README

欢迎来到懒人世界

如果觉得好用,不要吝啬star(^▽^)

今后更新更多懒人插件,欢迎提bugs,交流,关注,star:githubgitee

更多优秀插件:

A-super-comprehensive: vue-webpack-bootstrap-js-nodejs-html-css-less等前端超级合集代码补全

A-super-themes: 荧光字体主题美化

A-super-translate: 英语小白必备悬浮翻译

A-super-change-case: 驼峰,下划线等词组格式互转

Snippets-for-mui: Mui框架代码补全

前言

虽然vscode商店有很多代码补全插件,但是怎么说。。太不友好!

大佬们都是英文注释,这让我们萌新怎么看~

于是..

自己动手写了这个插件

链接飞机

A-super-comprehensive下载地址

代码补全 包含 vue,webpack,bootstrap3,javascript,css,html,php,ajax,node 等等..

26国语翻译言 链接:点击

终极美化包 链接:点击

后期我们还会不断更新,当然您如果发现 bugs,可以点击github进行留言联系我

食用姿势

为了更好的体验推荐个人设置中将代码提示设置为穿插 "editor.snippetSuggestions": "inline",

由于本人比较懒,其实彩蛋很多,自行体会(●'◡'●)

  • 右击菜单打开查询笔记

只需要输入在相应的地方输入相应的快捷键,自动补全

有时候你也可以输入中文 , 自动补全

javaScript指南
内容快捷键
显示全部js
node类node
module.exportsme
淘宝flexble.js自适应csh
清除h5 click300ms延时csh
各种格式化format
笔记算法用法等help
获取类get
常用正则表达式zzbds
存储storage
touch手指触摸事件touch
物理像素比dpr
对象类dx
单词dc
location相关location
清除类clear
定时器dsq
事件sj
鼠标事件mouse
键盘事件key
选择元素(以及元素操作)dom
坐标zb
创建create
设置set
删除del
克隆clone
添加add
阻止(禁用)stop
封装的几个函数hs
兼容处理的函数jr
反选按钮fx
全选按钮qx
排序px
数组去重qc
构造函数gzhs
随机整数sjqz
获取时间time
倒计时djs
BOM加载事件load
动画函数dh
拖动元素td
放大镜fdj
根据浏览器不同实现跳转tz
导航栏鼠标动画效果nav
移动端拖动元素td
轮播图(移动端)lbt
返回顶部函数goback
判断is
自调用函数!
改变this指向changethis
原型继承yxjc
图片即时预览yl
状态码ztm
创建异步对象create
ajax相关ajax
监听响应状态listen
判断服务器成功响应且数据解析完成is
异步对象发送GET请求xhr
服务器返回值res
服务器成功响应且数据解析完毕可以使用ajaxon
vue指南

基于最新的 Vue 2 的 API 添加了Code Snippets,以及部分常用代码块模板. 沿用vue 2 Snippets插件使用方法

Including most of the API of Vue.js 2. You can type vcom, choose VueConfigOptionMergeStrategies, and press ENTER, then Vue.config.optionMergeStrategies appear on the screen.

插件的 Snippets 如下表格所示,比如你可以键入 vcom 然后按上下键选中 VueConfigOptionMergeStrategies 再按Enter键,就输入了Vue.config.optionMergeStrategies了。

As shown in the table below, snippet vmData has body like ${this, vm}.$data will provides choice this.$data and vm.$data to you.

如下表所示,vmData 的内容是 ${this, vm}.$data,这表明这个 snippet 会提供 this.$data and vm.$data 两种选项供你选择。

大类别的使用:

如果你想找vue全局配置  键入 `vue-config`api类  键入`api`axios:  键入`axios`  配置相关(如配置baseURL,拦截器等),  第二类键入 `config`  
PrefixJavaScript Snippet Content
axios-get/post/delete/put发送axios请求
axios-config-baseURL配置请求的基准URL地址
axios-config-headers配置请求头信息
axios-config-interceptors-requestaxios设置请求拦截器
axios-config-interceptors-responseaxios设置响应拦截器
importimport ... from ...
newVuenew Vue({...})
VueConfigSilentVue.config.silent = true
VueConfigOptionMergeStrategiesVue.config.optionMergeStrategies
VueConfigDevtoolsVue.config.devtools = true
VueConfigErrorHandlerVue.config.errorHandler = function (err, vm, info) {...}
VueConfigWarnHandlerVue.config.warnHandler = function (msg, vm, trace) {...}
VueConfigIgnoredElementsVue.config.ignoredElements = [''] \
VueConfigKeyCodesVue.config.keyCodes
VueConfigPerformanceVue.config.performance = true
VueConfigProductionTipVue.config.productionTip = false
vueExtendVue.extend( options )
VueNextTickVue.nextTick( callback, [context] )
VueNextTickThenVue.nextTick( callback, [context] ).then(function(){ })
VueSetVue.set( target, key, value )
VueDeleteVue.delete( target, key )
VueDirectiveVue.directive( id, [definition] )
VueFilterVue.filter( id, [definition] )
VueComponentVue.component( id, [definition] )
VueUseVue.use( plugin )
VueMixinVue.mixin({ mixin })
VueCompileVue.compile( template )
VueVersionVue.version
datadata() { return {} }
watchWithOptionskey: { deep: true, immediate: true, handler: function () { } }
vmData${this, vm}.$data
vmProps${this, vm}.$props
vmEl${this, vm}.$el
vmOptions${this, vm}.$options
vmParent${this, vm}.$parent
vmRoot${this, vm}.$root
vmChildren${this, vm}.$children
vmSlots${this, vm}.$slots
vmScopedSlots${this, vm}.$scopedSlots.default({})
vmRefs${this, vm}.$refs
vmIsServer${this, vm}.$isServer
vmAttrs${this, vm}.$attrs
vmListeners${this, vm}.listeners
vmWatch${this, vm}.$watch( expOrFn, callback, [options] )
vmSet${this, vm}.$set( object, key, value )
vmDelete${this, vm}.$delete( object, key )
vmOn${this, vm}.$on( event, callback )
vmOnce${this, vm}.$once( event, callback )
vmOff${this, vm}.$off( [event, callback] )
vmEmit${this, vm}.$emit( event, […args] )
vmMount${this, vm}.$mount( [elementOrSelector] )
vmForceUpdate${this, vm}.$forceUpdate()
vmNextTick${this, vm}.$nextTick( callback )
vmDestroy${this, vm}.$destroy()
rendererconst renderer = require('vue-server-renderer').createRenderer()
createRenderercreateRenderer({ })
preventDefaultpreventDefault();
stopPropagationstopPropagation();

PrefixHTML Snippet Content
template<template></template>
script<script></script>
style<style></style>
vTextv-text=msg
vHtmlv-html=html
vShowv-show
vIfv-if
vElsev-else
vElseIfv-else-if
vForWithoutKeyv-for
vForv-for="" :key=""
vOnv-on
vBindv-bind
vModelv-model
vPrev-pre
vCloakv-cloak
vOncev-once
key:key
refref
slotAslot=""
slotE<slot></slot>
slotScopeslot-scope=""
component<component :is=''></component>
keepAlive<keep-alive></keep-alive>
transition<transition></transition>
transitionGroup<transition-group></transition-group>
enterClassenter-class=''
leaveClassleave-class=''
appearClassappear-class=''
enterToClassenter-to-class=''
leaveToClassleave-to-class=''
appearToClassappear-to-class=''
enterActiveClassenter-active-class=''
leaveActiveClassleave-active-class=''
appearActiveClassappear-active-class=''
beforeEnterEvent@before-enter=''
beforeLeaveEvent@before-leave=''
beforeAppearEvent@before-appear=''
enterEvent@enter=''
leaveEvent@leave=''
appearEvent@appear=''
afterEnterEvent@after-enter=''
afterLeaveEvent@after-leave=''
afterAppearEvent@after-appear=''
enterCancelledEvent@enter-cancelled=''
leaveCancelledEvent@leave-cancelled=''
appearCancelledEvent@appear-cancelled=''

PrefixVue Router Snippet Content
routerLink<router-link></router-link>
routerView<router-view></router-view>
toto=""
tagtag=""
newVueRouterconst router = newVueRouter({ })
routerBeforeEachrouter.beforeEach((to, from, next) => { }
routerBeforeResolverouter.beforeResolve((to, from, next) => { }
routerAfterEachrouter.afterEach((to, from) => { }
routerPushrouter.push()
routerReplacerouter.replace()
routerGorouter.back()
routerBackrouter.push()
routerForwardrouter.forward()
routerGetMatchedComponentsrouter.getMatchedComponents()
routerResolverouter.resolve()
routerAddRoutesrouter.addRoutes()
routerOnReadyrouter.onReady()
routerOnErrorrouter.onError()
routesroutes: []
beforeEnterbeforeEnter: (to, from, next) => { }
beforeRouteEnterbeforeRouteEnter (to, from, next) { }
beforeRouteLeavebeforeRouteLeave (to, from, next) { }
scrollBehaviorscrollBehavior (to, from, savedPosition) { }

PrefixVuex Snippet Content
newVuexStoreconst store = new Vuex.Store({ })
PrefixNuxt.js Snippet Content
nuxt<nuxt/>
nuxtChild<nuxt-child/>
nuxtLink<nuxt-link to=""/>
asyncDataasyncData() {}
element指南

配合element-helper 使用更方便

Bootstrap3指南

此部分插件食用说明单独做成阅读文档 详细说明地址1 , 详细说明地址2

bootstrap3参考官网文档bootstrap3文档

创建一个新的HTML文档并键入“bs3”以查看所有可用的代码段。

例:如果你想用bootstrap3,键入bs3,想要通栏block,想要链接型link,想要按钮button,想要导航nav等等

再举个栗子:如果你想用栏栅系统 输入b35,b37,就可以分出5份跟7份的一排格栅

css/less指南
内容快捷键
显示全部html
显示全部css
初始化csh
文本超出省略sl
transform连写transform
动画dh
flex相关属性flex
@media@
webpack指南

前缀wp4,即 想查找所有webpack相关代码,键入 wp4

  • wp4-template
  • wp4-dev-server
  • wp4-source-map
  • wp4-inline-source-map
  • wp4-loader-babel
  • wp4-loader-css
  • wp4-loader-less
  • wp4-loader-scss
  • wp4-loader-ts
  • wp4-loader-url
  • wp4-loader-img
  • wp4-loader-ttf
  • wp4-optimization
  • wp4-requireHTMLPlugin
  • wp4-requireCleanPlugin
  • wp4-clean-plugin
  • wp4-html-plugin
  • wp4-resolve
nodeJS指南

快捷键 nodejs查看所有

node中以node为前缀激活, 模块化激活例:node-file,查看常用file模块

npm 常用资源包 键入npm

提供两种模式

完整版跟片段版本,举个栗子:(读取文件)`node-file`中补全的是从引入fs模块开始的完整的代码片段`readFile`的提示补全的是读取文件的剩下代码片段

可以使用以下命令:

  • node-express,express 服务器 相关
  • node-http,HTTP服务器 相关
  • node-file,常用文件操作 相关
  • node-mysql,数据库操作 相关
  • node-event-emitter,创建事件发射器,发出事件和节目以订阅所述事件
  • node-promise-create,创造一个承诺
  • node-promise-shorthand,创建使用静态方法的承诺resolve()和reject()
  • node-promise-all,使用该Promise.all([])方法解析Promise列表
  • node-async-await,使用async / await
  • node-express-schema-validation,为express添加模式验证,点击这里可以阅读有关模式验证用法的更多信息
jquery指南
内容快捷键
显示全部jq...

如果你需要使用ajax,那么就是jqajax

php指南
内容快捷键
显示常用php
php基础设置config
mysqli操作类mysqli
sql语句sql
获取类get
判断类is
删除类del
header的设置header
文件操作file
json格式转换json
创建类create
修改类change
执行类(使用)use
封装的函数hs
React
内容快捷键
一键创建模板!-react
一键创建高阶组件模板!-react-HOC
一键创建高阶组件demo(获取鼠标位置)!-react-HOC-demo
一键创建hoos基础模板!-react-hooks
状态修改(回调函数)this.setState
表单快速双向绑定handleChange
表单快速双向绑定(一对多)handleChange
非受控组件(直接操作DOM)ref
Fragment占位符(无结构DIV)Fragment
reducer模板reducer

通信 前缀 tx

内容快捷键
自定义事件通信,新建events.jstx-event-newEventEmitter
EventEmitter自定义事件触发(调用)tx-event-emit
EventEmitter自定义通信监听tx-event-addListener
createContext(跨级组件通信)tx-createContext
Provider(跨级通信传递)tx-Provider
Consumer(跨级通信接收)tx-Consumer

生命周期 前缀 sm

内容快捷键
constructor(挂载阶段生命周期)sm-constructor
render(挂载阶段/更新阶段生命周期)sm-render
componentDidMount(挂载阶段生命周期)sm-componentDidMount
componentDidUpdata(更新阶段生命周期)sm-componentDidUpdate
componentWillUnmount(卸载阶段生命周期)sm-componentWillUnmount
shouldComponentUpdate(更新阶段生命周期)sm-shouldComponentUpdate

路由相关 前缀 route

内容快捷键
引入 react-routerroute
react-router容器(跳转的内容)route
路由容器route
嵌套路由容器route
接收路由参数route-params
跳转导航链接route-link
编程式导航route-push
Switch组件(只匹配第一个路由规则)route-Switch
Redirect重定向route-redirect

Hook 前缀 hook

内容快捷键
StateHook(类似constructor)hook-useState
EffectHook(类似componentDidMount+componentDidUpdata)hook-effect
ContextHookhook-useContext
MemoHookhook-useMemo
ReducerHookhook-useReducer

UmiJs配置 umirc相关 前缀 umircdva 前缀 dva

React-native指南(jsx)

组件

内容快捷键
一键创建模板!-react
基础组件模板!-react-native
顶部导航(注释版)rn-help-bar
顶部导航rn-bar,rn-createStackNavigator
底部导航卡(注释版)rn-help-bar
底部导航卡rn-createBottomTabNavigator,rn-bar
StyleSheet(样式表)rn-stylesheet
获取自适应屏幕宽度rn-dimensions
轮播图(注释版)rn-help-lbt
轮播图rn-carousel
跳转tabBarrn-onpress
顶部导航动态rn-navigationOptions
ActivityIndicatorrn-ActivityIndicator
Buttonrn-Button
TouchableOpacityrn-TouchableOpacity
DatePickerIOSrn-DatePickerIOS
DrawerLayoutAndroidrn-DrawerLayoutAndroid
Imagern-Image
KeyboardAvoidingViewrn-KeyboardAvoidingView
Modalrn-Modal
Pickerrn-Picker
PickerIOSrn-PickerIOS
ProgressBarAndroidrn-ProgressBarAndroid
ProgressViewIOSrn-ProgressViewIOS
ScrollViewrn-ScrollView
ScrollView(详细)rn-ScrollView
SegmentedControlIOSrn-SegmentedControlIOS
StatusBarrn-StatusBar
Switchrn-Switch
Textrn-Text
Viewrn-View
TextInput(详细)rn-TextInput
TextInputrn-TextInput
ToolbarAndroidrn-ToolbarAndroid

api代码段

内容快捷键
ActionSheetIOS(弹出操作表)rn-api-ActionSheetIOS
ActionSheetIOS(弹出分享框)rn-api-ActionSheetIOS
Alertrn-api-Alert

Known Issues

由于自启插件设置为全局,开启 VScode 加载会较慢(0.3-1S)

Release Notes

Tip: 超过 2000 种常用快捷补全及注释用法 自启笔记页

全局设置

  • 如果你安装了jQuery Code Snippets插件

    使用前必须卸载(禁用)jQuery Code Snippets

  • 如果你想禁用开启vscode时自启笔记页(可以通过右键查询web笔记)

    vscodePluginDemo.showTip:false

For more information

Enjoy!


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap