• Stars
    star
    1,317
  • Rank 35,709 (Top 0.8 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 7 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

These snippets were built to supercharge my workflow in the most seamless manner possible.

Vue VSCode Snippets

vue-snippet-hero

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

Installation

Either

  • click the extensions button (lowest square icon in the editor), and type in Vue VSCode Snippets, select the one by sdras

or

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

Snippet Purpose
vbase Single file component base with SCSS
vbase-3 Single File component Composition API with SCSS
vbase-3-setup Single File component setup Composition API with SCSS
vbase-3-reactive Single File component Composition API with Reactive and SCSS
vbase-css Single file component base with CSS
vbase-pcss Single file component base with PostCSS
vbase-styl Single file component base with Stylus
vbase-ts Single file component base with Typescript
vbase-ts-class Single file component base with Typescript Class Format
vbase-3-ts Single File component Composition API with Typescript
vbase-3-ts-setup Single File component setup Composition API with Typescript
vbase-ns Single file component with no styles
vbase-sass Single file component base with SASS
vbase-less Single file component 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 - onBeforeUpdate
v3onupdated Lifecycle hook - onUpdated
v3onerrorcaptured Lifecycle hook - onErrorCaptured
v3onunmounted Lifecycle hook - (destroyed) onUnmounted
v3onbeforeunmount Lifecycle hook - (beforeDestroy) onBeforeUnmount
v3useinoptions Use Composition API in Options API

Vuex

Snippet Purpose
vstore Base for Vuex store.js
vgetter Vuex Getter
vmutation Vuex Mutation
vaction Vuex Action
vmodule Vuex Module
vstore-import Import vuex store into main.js
vstore2 Updated Base for Vuex store

Vue Router

Snippet Purpose
vrouter Vue Router base
vscrollbehavior Vue Router scrollBehavior
vbeforeeach Vue Router global guards beforeEach
vbeforeresolve Vue Router global guards beforeResolve
vaftereach Vue Router global guards afterEach
vbeforeenter Vue Router per-route guard beforeEnter
vbeforerouteenter Vue Router component guards beforeRouteEnter
vbeforerouteupdate Vue Router component guards beforeRouteUpdate
vbeforerouteleave Vue Router component guards beforeRouteLeave

Vue Config

Snippet Purpose
vplugin Import a plugin to main.js or plugins file
vconfig vue.config.js file, example imports a sass file into every component

Nuxt Config

Snippet Purpose
nfont link to include fonts in a nuxt project, in nuxt-config
ncss link to css assets such as normalize

Nuxt Page

Snippet Purpose
nasyncdata Nuxt asyncData
nasyncdataaxios Nuxt asyncData with Axios module
nfetch Nuxt Fetch
nfetchaxios Nuxt Fetch with Axios module
nhead Nuxt Head
nparam Nuxt Route Params

Extra (plaintext)

Snippet Purpose
gitignore .gitignore file presets

Contributing

This is an open source project open to anyone. Contributions are welcome github

If you are contributing a snippet, please be sure to add the documentation for it in the tables in the README, the pull request cannot be accepted without this addition. Thanks!

More Repositories

1

awesome-actions

A curated list of awesome actions to use on GitHub
24,493
star
2

cssgridgenerator

๐Ÿงฎ Generate basic CSS Grid code to make dynamic layouts!
Vue
4,995
star
3

night-owl-vscode-theme

๐ŸŒŒ NIGHT OWL: A VS Code dark theme for contrast for nighttime coding, ๐Ÿฆ‰ LIGHT OWL: a daytime light theme
2,805
star
4

intro-to-vue

Workshop Materials for my Introduction to Vue.js Workshop
Vue
2,788
star
5

array-explorer

โšก๏ธ A resource to help figure out what JavaScript array method would be best to use at any given time
JavaScript
2,619
star
6

page-transitions-travelapp

Travel App, Native-like Page Transitions
Vue
1,715
star
7

ecommerce-netlify

๐Ÿ› A JAMstack Ecommerce Site built with Nuxt and Netlify Functions
Vue
1,539
star
8

object-explorer

๐Ÿ”ฅ A resource to help figure out what JavaScript object method would be best to use at any given time
JavaScript
1,402
star
9

sample-vue-shop

See readme for newer repo details! A sample shop that shows how to manage payments with Vue, Stripe, and Serverless Functions
Vue
1,213
star
10

svg-workshop

Materials for SVG Essentials & Animation Course
HTML
799
star
11

career-ladders

A sample of career ladders I use for my organization, open sourced for anyone.
Vue
794
star
12

design-for-developers

Design for Developers Workshop
735
star
13

hero-generator

๐Ÿฆธ๐Ÿปโ€โ™€๏ธHero Generator! Create a nice hero image for your site or app
Vue
643
star
14

project-explorer

๐ŸŽ‹A CLI tool to create an annotated tree visualization of any project
JavaScript
535
star
15

vue-sample-svg-icons

An opinionated example of how to use SVG icons in a Vue.js application
Vue
522
star
16

js-explorer

Find the method you need without digging through the docs, directly on the command line!
JavaScript
321
star
17

building-web-apps-with-vue

building-web-app-with-vue
Vue
300
star
18

vue-vscode-extensionpack

The extensions I use when developing a Vue application with VS Code
273
star
19

JS-stroll

Rewriting code from other languages or other technologies into Vanilla JS and SVG for fun and practice.
JavaScript
213
star
20

frontendmasters-svganimation

Frontend Masters- Advanced SVG Animation Course
HTML
196
star
21

vue-weather-notifier

A small SVG animation illustrating a weather app notification in Vue
Vue
196
star
22

vue-hooks-foodapp

A food app using a few hooks in Vue to show how they can work (experimental)
Vue
180
star
23

productive-twitter

Chrome extension: Minimal and friendly theme for productive twitter use
CSS
179
star
24

fortnite-vscode-theme

JavaScript
171
star
25

vue-directory-tree

A visualization of relevant files for vue repo, along with notes
JavaScript
163
star
26

page-transitions-simple

Vue/Nuxt Page Transitions- Simple Demonstration
Vue
158
star
27

sample-stripe-handler

Serverless function that uses the stripe api for a checkout process in a Vue application
JavaScript
157
star
28

animated-guide-vue3

154
star
29

vue-sublime-snippets

Simplify and supercharging my workflow with snippets for Vue.js that help me spin things up quickly
142
star
30

signals-demo

โšก๏ธ A small demo site to explain some of the cool things Signals-based reactivity does in Angular
HTML
137
star
31

inbedby7pm

My other theme was for Night Owls like myself. This theme was requested for by the "In Bed by 7pm" crowd
135
star
32

is-this-a-sandwich

Is this a sandwich?
Vue
105
star
33

cda-locale

Showing Microsoft Cloud Developer Advocates speaking, 2017 and 2018
JavaScript
105
star
34

three-vue-pattern

A biofeedback visualization made with Three.js, Vue, and LUIS (cognitive services), made with Brian Holt
Vue
102
star
35

gsap-player

A small, customizable youtube-like player for gsap timelines
JavaScript
99
star
36

livecode-svganimation

In my Smashing Toronto talk, I'll be live coding an SVG animation from start to finish. Here's the repo that houses the base materials, and any further references for things we don't have time to cover.
JavaScript
95
star
37

recipe-box

Vue
94
star
38

netlify-functions-example

HTML
72
star
39

firefighter-demo

๐Ÿšจ Demo to improve an existing firefighter app by making it queue tasks offline
HTML
68
star
40

smashing

This was the result of a live code talk at Smashing Conf in Toronto, this is how far I got in 45 minutes
Vue
67
star
41

example-azure-node

An example Node webapp deployed with GitHub actions
Shell
67
star
42

JAMstack-Workshop

Workshop materials for JAMstack workshop using Vue and Netlify.
Vue
64
star
43

docs-extensionpack

A collection of extensions for writing, editing, and reviewing documentation in VS Code
56
star
44

vue-wine-label

A very silly demo showing how to make a wine label making dashboard with Vue.js
JavaScript
56
star
45

contentful-nuxt-netlify

Example setup for Contentful and Nuxt on Netlify
Vue
49
star
46

favegame

Small starter example of Hasura, Nuxt, and Netlify for Jamstack/SSR rendering
Vue
46
star
47

headless-wp-nuxt2

Vue
38
star
48

sdras

it me!
29
star
49

d3-example-ignitetour

This repo serves as an example for Microsoft Ignite the Tour. In this session, we explore how to create basic charts and graphs using d3.
JavaScript
21
star
50

react-aframe-demo1

React A-Frame Demo 1
JavaScript
18
star
51

data-in-motion

My talk about the importance of animation in data visualizations
JavaScript
16
star
52

perfmatters-demo

demo for perfmatters conf https://perfmattersconf.com/
Vue
12
star
53

smashing-template

a base of the smashing talk
Vue
11
star
54

jamstack-template

HTML
11
star
55

devex-utm-builder

HTML
10
star
56

Benchmarking-Animations

Writing the same simple animation in a loop in SMIL, Canvas, CSS, and Velocity for benchmarking purposes.
CSS
8
star
57

easiest-netlify-lambda-example

JavaScript
7
star
58

gcp-ng-alt

TypeScript
6
star
59

Transform_intro

Introduction to Transforms, with the use of a transition in a class applied to all examples
5
star