Home > Development Tools > VSCode > body text

Introduction to how to quickly build vue templates in vscode

青灯夜游
Release: 2020-10-23 17:34:45
forward
2744 people have browsed it

vscode如何快速搭建vue模板?下面本篇文章给大家介绍一下。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。

Introduction to how to quickly build vue templates in vscode

相关推荐:《vscode基础教程》、《vue.js教程

文件 -> 首选项 -> 用户代码片段
搜索vue

vue2.x添加下方代码

{

 "Print to console": {

 "prefix": "vue",

 "body": [

 "<!-- $0 -->",

 "<template>",

 "  <p></p>",

 "</template>",

 "",

 "<script>",

 "export default {",

 "  data () {",

 "    return {",

 "    };",

 "  },",

 "",

 "  components: {},",

 "",

 "  computed: {},",

 "",

 "  mounted: {},",

 "",

 "  methods: {}",

 "}",

 "",

 "</script>",

 "<style lang=&#39;scss&#39; scoped>",

 "</style>"

 ],

 "description": "Log output to console"

 }

 }
Copy after login

vue3.x添加下方代码

{
"Print to console": {

 "prefix": "vue3",

 "body": [

 "<!-- $0 -->",

 "<template>",

 "  <p></p>",

 "</template>",

 "",

 "<script>",

 "import { computed, reactive, ref, watch, onMounted,onUpdate,onUnmounted} from &#39;vue&#39;;",

 "export default {",

 "setup(){",

 "//类mounted",

 "onMounted(()=>{",

 "",

 "})",

 "//相当于updated",

 "onUpdate(()=>{",

 "",

 "})",

 "//相当于destroyen",

 "onUnmounted(()=>{",

 "",

 "})",

 "return {}",

 "}",

 "}",

 "",

 "</script>",

 "<style lang=&#39;scss&#39; scoped>",

 "</style>"

 ],

 "description": "Log output to console"

 }
 }
Copy after login

新建.vue文件后   

Introduction to how to quickly build vue templates in vscode

相关推荐:

2020年前端vue面试题大汇总(附答案)

vue教程推荐:2020最新的5个vue.js视频教程精选

更多编程相关知识,请访问:编程入门!!

The above is the detailed content of Introduction to how to quickly build vue templates in vscode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template