Skip to content

Commit 8ec8def

Browse files
author
Mauro Vieira
committed
- Added more snippets.
1 parent 938bbd3 commit 8ec8def

File tree

7 files changed

+99
-3
lines changed

7 files changed

+99
-3
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Vue Sublime Snippets
2+
3+
<p align="center"><img src="assets/vue-logo.png" width="360"/></p>
4+
5+
## Installation
6+
7+
Manually:
8+
9+
1. Download [latest release](https://github.com/pichillilorenzo/JavaScriptEnhancements/releases) (**DON'T CLONE THE REPOSITORY!**) and unzip it into your **Packages folder** (go to `Preferences > Browse Packages...` menu item to open this folder)
10+
2. Rename the folder with `JavaScript Enhancements` name (**THIS STEP IS IMPORTANT**).
11+
12+
If all is going in the right way, you will see `JavaScript Enhancements - installing npm dependencies...` and, after a while, `JavaScript Enhancements - npm dependencies installed correctly.` messages in the status bar of Sublime Text 3. Now the plugin is ready!
13+
14+
## Snippets
15+
16+
### Vue
17+
18+
| Snippet | Purpose |
19+
| ------- | -------------------------- |
20+
| `vbase` | Single file component base |
21+
22+
### Template
23+
24+
| Snippet | Purpose |
25+
| ----------------- | ----------------------------------- |
26+
| `vclass` | Class binding |
27+
| `vfor` | v-for directive |
28+
| `vif` | v-if directive |
29+
| `vmodel` | Semantic v-model directive |
30+
| `von` | v-on click handler with arguments |
31+
| `vshow` | v-show directive |
32+
| `vsrc` | Image src binding |
33+
| `vstyle` | Inline style binding |
34+
35+
### Script
36+
37+
| Snippet | Purpose |
38+
| ---------------- | ------------------------------------------------------------------------ |
39+
| `vcomputed` | Vue computed property |
40+
| `vdata` | Component data as a function |
41+
| `vdestroyed` | Vue destroyed |
42+
| `vdirectives` | Vue create a custom directive |
43+
| `vfilter` | Vue filter |
44+
| `vimport` | Import one component into another |
45+
| `vmethods` | Vue methods |
46+
| `vmixin` | Create a Vue Mixin |
47+
| `vmounted` | Vue mounted |
48+
| `vprops` | Props with type and default |
49+
| `vwatch` | Vue watcher with new and old value args |
50+
51+
### Vuex
52+
53+
| Snippet | Purpose |
54+
| --------------- | ------------------------------ |
55+
| `vactions` | Vuex Actions |
56+
| `vgetters` | Vuex Getter |
57+
| `vmutations` | Vuex Mutations |
58+
59+
60+
## License
61+
62+
**Sublime Vue Snippets** is open-sourced software licensed under the \[MIT license\](http://opensource.org/licenses/MIT)
63+
64+
Created with ♥️ by [@mauroreisvieira](https://twitter.com/mauroreisvieira) in **Portugal**

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"author": "Mauro Reis Vieira <mauroreisvieira@gmail.com>",
33
"name": "vue-sublime-snippets",
4-
"displayName": "Vue Sublime Text Snippets",
4+
"displayName": "Vue Sublime Snippets",
55
"description": "Sippets to help you in the development of projects.",
66
"icon": "assets/vue-logo.png",
77
"license": "MIT",
88
"version": "1.0.0",
9-
"repository": "https://bitbucket.org/mauroreisvieira/sublime-vue-snippets",
9+
"repository": "https://github.com/maurovieirareis/sublime-vue-snippets",
1010
"bugs": {
1111
"url": "https://github.com/maurovieirareis/sublime-vue-snippets/issues"
1212
},

snippets/vclass.sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
<${1:div} :class="{ ${2:className}: ${3:data} }"></${1:div}>
4+
]]></content>
5+
<tabTrigger>vclass</tabTrigger>
6+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
7+
<!-- <scope>source.vue</scope> -->
8+
</snippet>

snippets/vmodel.sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
<input v-model="${1:data}" type="text" />
4+
]]></content>
5+
<tabTrigger>vmodel</tabTrigger>
6+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
7+
<!-- <scope>source.vue</scope> -->
8+
</snippet>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ snippet>
22
<content><![CDATA[
33
@click="$1"
44
]]></content>
5-
<tabTrigger>vclick</tabTrigger>
5+
<tabTrigger>von</tabTrigger>
66
<!-- Optional: Set a scope to limit where the snippet will trigger -->
77
<!-- <scope>source.vue</scope> -->
88
</snippet>

snippets/vsrc.sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
<img :src="${1:fileName}" alt="${2:altText}"/>
4+
]]></content>
5+
<tabTrigger>vsrc</tabTrigger>
6+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
7+
<!-- <scope>source.vue</scope> -->
8+
</snippet>

snippets/vstyle.sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
<${1:div} :style="{ fontSize: ${2:data} + 'px' }"></${1:div}>
4+
]]></content>
5+
<tabTrigger>vstyle</tabTrigger>
6+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
7+
<!-- <scope>source.vue</scope> -->
8+
</snippet>

0 commit comments

Comments
 (0)