步骤:设置=> 用户代码片段=> 新建vue3文件夹的代码片段
{
"Print to console": {
"prefix": "vue3",
"body": [
"<template>",
" <div></div>",
"</template>",
"",
"<script lang='ts'>",
"import { reactive,toRefs,onBeforeMount,onMounted} from 'vue'",
"interface DataProps {}",
"export default {",
" name: '',",
" setup() {",
" const data: DataProps = reactive({",
"",
" })",
" onBeforeMount(() => {",
" })",
" onMounted(() => {",
" })",
" const refData = toRefs(data);",
" return {",
" ...refData,",
" }",
"",
" }",
" };",
"</script>",
"<style scoped>",
"</style>",
],
"description": "Log output to console"
}
}
网友评论