# Vue VSCode Snippets
![vue-snippet-hero](https://s3-us-west-2.amazonaws.com/s.cdpn.io/28963/vue-snippet-hero.gif)
## Description
These snippets were built to supercharge a workflow in the most seamless manner possible.
This repo was built particularly for real world use. It doesn't catalogue the API definitions, rather, it focuses on developer ergonomics from the point of Vue of real world use. Included are the pieces I personally get sick of typing, and boilerplate that is helpful to stub out quickly.
_Versions Supported: Vue 2 and Vue 3_
![SnippetDemo](https://s3-us-west-2.amazonaws.com/s.cdpn.io/28963/SnippetDemo.gif)
## Installation
_Either_
- click the extensions button (lowest square icon in the editor), and type in Vue VSCode Snippets, select the one by sdras
_or_
- go here [vscode Extensions Marketplace](https://marketplace.visualstudio.com/items?itemName=sdras.vue-vscode-snippets)
```javascript
ext install Vue VSCode Snippets
```
You can enable tab completion (recommended) by opening `Code > Preferences > Settings` (on a Mac) and applying `"editor.tabCompletion": "onlySnippets"` to your personal settings
## Snippets
### Vue
These snippets are meant to provide a base scaffold for your single file components (SFC).
| Snippet | Purpose |
| ------------------ | ------------------------------------------ |
| `vbase-3-ss` | SFC base with script setup |
| `vbase-3-ss-ts` | SFC base with script setup and TypeScript |
| `vbase` | SFC base with SCSS |
| `vbase-3` | SFC Composition API with SCSS |
| `vbase-3-setup` | SFC setup Composition API with SCSS |
| `vbase-3-setup` | SFC setup Composition API with SCSS |
| `vbase-3-reactive` | SFC Composition API with Reactive and SCSS |
| `vbase-css` | SFC base with CSS |
| `vbase-pcss` | SFC base with PostCSS |
| `vbase-styl` | SFC base with Stylus |
| `vbase-ts` | SFC base with Typescript |
| `vbase-ts-class` | SFC base with Typescript Class Format |
| `vbase-3-ts` | SFC Composition API with Typescript |
| `vbase-3-ts-setup` | SFC setup Composition API with Typescript |
| `vbase-ns` | SFC with no styles |
| `vbase-sass` | SFC base with SASS |
| `vbase-less` | SFC base with LESS |
### Template
| Snippet | Purpose |
| ----------------- | ----------------------------------- |
| `vfor` | v-for directive |
| `vmodel` | Semantic v-model directive |
| `vmodel-num` | Semantic v-model number directive |
| `von` | v-on click handler with arguments |
| `vslot-named` | Named slot |
| `vel-props` | Component element with props |
| `vsrc` | Image src binding |
| `vstyle` | Inline style binding |
| `vstyle-obj` | Inline style binding with objects |
| `vclass` | Class binding |
| `vclass-obj` | Class binding with objects |
| `vclass-obj-mult` | Multiple conditional class bindings |
| `vanim` | Transition component with JS hooks |
| `vnuxtl` | Nuxt Routing Link |
| `vroutename` | router-link Named Routing |
| `vroutenameparam` | router-link Named with Parameters |
| `vroutepath` | router-link Path Routing Link |
| `vemit-child` | Emit event from child component |
| `vemit-parent` | Emit event to parent component |
### Script
| Snippet | Purpose |
| ----------------- | ------------------------------------------------------------------------ |
| `vdata` | Component data as a function |
| `vmethod` | Vue method |
| `vcomputed` | Vue computed property |
| `vwatcher` | Vue watcher with new and old value args |
| `vbeforecreate` | beforeCreate lifecycle method |
| `vcreated` | created lifecycle method |
| `vbeforemount` | beforeMount lifecycle method |
| `vmounted` | vmounted lifecycle method |
| `vbeforeupdate` | beforeUpdate lifecycle method |
| `vupdated` | updated lifecycle method |
| `vbeforedestroy` | beforeDestroy lifecycle method |
| `vdestroyed` | destroyed lifecycle method |
| `vprops` | Props with type and default |
| `vimport` | Import one component into another |
| `vimport-dynamic` | Import one component that should be lazy loaded by webpack |
| `vcomponents` | Import one component into another within the export statement |
| `vimport-export` | Import one component into another and use it within the export statement |
| `vmapstate` | import mapState from Vuex into vue component component |
| `vmapgetters` | import mapGetters from Vuex into vue component component |
| `vmapmutations` | import mapMutations from Vuex into vue component component |
| `vmapactions` | import mapActions from Vuex into vue component component |
| `vfilter` | Vue filter |
| `vmixin` | Create a Vue Mixin |
| `vmixin-use` | Bring a mixin into a component to use |
| `vc-direct` | Vue create a custom directive |
| `vimport-lib` | Import a library |
| `vimport-gsap` | Import GreenSock |
| `vanimhook-js` | Using the Transition component JS hooks in methods |
| `vcommit` | Commit to Vuex store in methods for mutation |
| `vdispatch` | Dispatch to Vuex store in methods for action |
| `vtest` | A simple unit testing component |
### Vue Composition API
| Snippet | Purpose |
| ------------------- | ----------------------------------------------------- |
| `v3reactive` | Vue Composition API - reactive |
| `v3reactive-setup` | Vue Composition API - reactive with setup boilerplate |
| `v3computed` | Vue Composition API - computed |
| `v3watch` | Vue Composition API - watcher single source |
| `v3watch-array` | Vue Composition API - watch as array |
| `v3watcheffect` | Vue Composition API - watchEffect |
| `v3ref` | Vue Ref |
| `v3onmounted` | Lifecycle hook - onMounted |
| `v3onbeforemount` | Lifecycle hook - onBeforeMount |
| `v3onbeforeupdate` | Lifecycle hook - onBeforeUpdat
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Vue VSCode 代码片段描述这些片段是为了以最无缝的方式增强工作流程而构建的。此 repo 专为实际使用而构建。它不编目 API 定义,而是从 Vue 的实际使用角度着眼于开发人员的人体工程学。其中包括我个人厌倦输入的部分,以及有助于快速删除的样板。支持的版本Vue 2 和 Vue 3安装任何一个单击扩展按钮(编辑器中最下面的方形图标),然后输入 Vue VSCode Snippets,选择 sdras 的那个或者点击此处vscode 扩展市场ext install Vue VSCode SnippetsCode > Preferences > Settings您可以通过打开(在 Mac 上)并应用"editor.tabCompletion": "onlySnippets"到您的个人设置来启用制表符补全(推荐)片段Vue这些代码片段旨在为您的单文件组件(SFC)提供基础支架。片段 目的vbase-3-ss 带脚本设置的 SFC 基础vbase-3-ss-ts 带有脚本设置和 TypeScript 的 SFC 基础vba
资源推荐
资源详情
资源评论
收起资源包目录
这些片段是为了以最无缝的方式增强我的工作流程而构建的。.zip (24个子文件)
yarn.lock 86B
snippets
vue.json 6KB
vue-template.json 4KB
vue-script.json 12KB
nuxt-config.json 419B
vue-script-router.json 3KB
ignore.json 2KB
nuxt-script.json 2KB
vue-pug.json 3KB
vue-script-setup.json 899B
vue-script-vuex.json 2KB
extension.js 1KB
.vscode
launch.json 378B
.github
FUNDING.yml 63B
标签.txt 35B
LICENSE 1KB
CHANGELOG.md 2KB
package.json 2KB
资源内容.txt 1003B
.gitignore 1KB
images
vue-snippet-hero.gif 45KB
vue-logo.png 4KB
SnippetDemo.gif 769KB
README.md 11KB
共 24 条
- 1
资源评论
徐浪老师
- 粉丝: 8285
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 施工人员防护具检测33-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord、VOC数据集合集.rar
- java小游戏,滚木块.zip学习资源代码
- 基于 C++实现的文件系统课程设计
- 分享:qt的Yolo图像处理模块(pri)
- 施工人员检测54-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma数据集合集.rar
- 基于Java + Mysql 实现的在线考试系统课程设计
- java小游戏,飞机大战0.1版本.zip
- 深度学习 python 特征标记
- GSD-file-for-DME5000-PROFIBUS-DC0000868.ZIP Firmware V1.5, V1.7, V2.0 SICK069D
- google-chrome-stable-124.0.6367.118-1.x86-64.rpm
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功