grasscutterTools/.vscode/vue.code-snippets

48 lines
961 B
Plaintext
Raw Normal View History

2022-05-02 10:38:10 +00:00
{
"store新建页面": {
"scope": "typescript",
"prefix": "store",
"body": [
"import { defineStore } from 'pinia'",
"import { piniaStore } from '@store'",
"",
"export const use$1Store = defineStore(",
" '${1/(.*)/${1:/camelcase}/}',",
" {",
" state: () => ({}),",
" getters: {},",
" actions: {}",
" }",
")",
"",
"export function use$1OutsideStore() {",
" return use$1Store(piniaStore)",
"}"
],
"description": "store page"
},
"vue新建页面": {
"scope": "vue",
"prefix": "page",
"body": [
"<template>",
" <div>",
" $3",
" </div>",
"</template>",
"",
"<script setup name='$1'>",
"// const { proxy } = getCurrentInstance()",
"// const router = useRouter()",
"// const route = useRoute()",
" $2",
"</script>",
"",
"<style lang='less' scoped>",
" $4",
"</style>"
],
"description": "vue page"
}
}