| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- {
- "Vue3 Component": {
- "scope": "vue",
- "prefix": "vue3",
- "description": "Vue3 + TypeScript 组件模板",
- "body": [
- "<!--",
- " @desc: $1",
- " @date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}",
- "-->",
- "",
- "<template>",
- " <div class=\"$TM_FILENAME_BASE\">{{ title }} </div>",
- "</template>",
- "",
- "<script setup lang=\"ts\">",
- " /** -------------------- 组件参数 -------------------- */",
- " interface Props {",
- " title?: string",
- " }",
- " const props = withDefaults(defineProps<Props>(), {",
- " title: 'hello'",
- " })",
- "",
- " /** -------------------- 生命周期 ----------------------- */",
- " onMounted(() => {",
- " console.log(`${props.title} mounted`)",
- " })",
- "</script>",
- "",
- "<style scoped lang=\"scss\">",
- " .${TM_FILENAME_BASE} {",
- " padding: 10px;",
- " }",
- "</style>",
- ""
- ]
- }
- }
|