教你用VS code 生成vue-cli代码片段

马克社区 2022-06-23 18:00:12 阅读数:212

vs生成code教你教你用

可以自定义设置名字:name.json

{
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
"<div class='$2'>$5</div>",
"</template>",
"",
"<script>",
"",
"export default {",
"name:'',",
"components: {},",
"data() {",
"return {",
"",
"};",
"},",
"computed: {},",
"watch: {},",
"methods: {",
"",
"},",
"//生命周期 - 创建完成(可以访问当前this实例)",
"created() {",
"",
"},",
"//生命周期 - 挂载完成(可以访问DOM元素)",
"mounted() {",
"",
"},",
"beforeCreate() {}, //生命周期 - 创建之前",
"beforeMount() {}, //生命周期 - 挂载之前",
"beforeUpdate() {}, //生命周期 - 更新之前",
"updated() {}, //生命周期 - 更新之后",
"beforeDestroy() {}, //生命周期 - 销毁之前",
"destroyed() {}, //生命周期 - 销毁完成",

更多内容请见原文,原文转载自:https://blog.csdn.net/weixin_44519496/article/details/119924429

版权声明:本文为[马克社区]所创,转载请带上原文链接,感谢。 https://cloud.tencent.com/developer/article/2028944