Last active
June 23, 2022 05:49
-
-
Save ainsofs/8efbf7452a38ed854f13b10b685c929c to your computer and use it in GitHub Desktop.
Vue3 Component template and snippet for vscode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<!--start-here--> | |
</div> | |
</template> | |
<script setup> | |
import { ref, computed } from 'vue' | |
// props and emits | |
const props = defineProps(['someProp']) | |
const emits = defineEmits(['someEmit']) | |
// data | |
const someVal = ref(null) | |
//computed | |
const someComputed = computed(() => { | |
return null | |
}) | |
//functions | |
function someFunction() { | |
// code here | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Vue3 Component Snippet by Ainsof So'o": { | |
"prefix": "vue3-default", | |
"body": [ | |
"<template>", | |
"<div>", | |
" <!--start-here-->", | |
"</div>", | |
"</template>", | |
"", | |
"<script setup>", | |
"import { ref, computed } from 'vue'", | |
"// props and emits", | |
"const props = defineProps(['someProp'])", | |
"const emits = defineEmits(['someEmit'])", | |
"// data", | |
"const someVal = ref(null)", | |
"//computed", | |
"const someComputed = computed(() => {", | |
" return null", | |
"})", | |
"//functions", | |
"function someFunction() {", | |
" // code here", | |
"}", | |
"</script>" | |
], | |
"description": "Vue3 Component Snippet by Ainsof So'o" | |
}, | |
"Create props": { | |
"prefix": "props", | |
"body": ["const props = defineProps(['someProp'])"], | |
"description": "Create props" | |
}, | |
"Create emits": { | |
"prefix": "emits", | |
"body": ["const emit = defineEmits(['someEmit'])"], | |
"description": "Create emits" | |
}, | |
"Create ref": { | |
"prefix": "ref", | |
"body": ["import { ref } from 'vue'", "const someVal = ref(null)"], | |
"description": "Create ref" | |
}, | |
"Create computed ": { | |
"prefix": "computed ", | |
"body": [ | |
"import { computed } from 'vue'", | |
"const someComputed = computed(() => {", | |
" return null", | |
"})" | |
], | |
"description": "Create computed " | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Vue3 Component Snippet by Ainsof So'o": { | |
"prefix": "vue3-default", | |
"body": [ | |
"<template>", | |
"<div>", | |
" <!--start-here-->", | |
"</div>", | |
"</template>", | |
"", | |
"<script setup>", | |
"import { ref, computed } from 'vue'", | |
"// props and emits", | |
"const props = defineProps(['someProp'])", | |
"const emits = defineEmits(['someEmit'])", | |
"// data", | |
"const someVal = ref(null)", | |
"//computed", | |
"const someComputed = computed(() => {", | |
" return null", | |
"})", | |
"//functions", | |
"function someFunction() {", | |
" // code here", | |
"}", | |
"</script>" | |
], | |
"description": "Vue3 Component Snippet by Ainsof So'o" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment