美文网首页工具
vscode新建vue项目和react项目

vscode新建vue项目和react项目

作者: 年轻人多学点 | 来源:发表于2020-06-29 17:07 被阅读0次

    新建vue项目

    1.文件 ==> 首选项 ==> 用户代码片段 ==> 输入 vue 然后回车
    2.添加配置,让vscode允许自定义的代码片段提示出来

     
    {
        "Print to console": {
            "prefix": "vue",
            "body": [
                "<template>",
                "  <div>",
                "    $0",
                "  </div>",
                "</template>",
                "",
                "<script>",
                "",
                "  export default {",
                "    name:'',",
                "    props:[''],",
                "    data () {",
                "      return {",
                "",
                "      };",
                "    },",
                "",
                "    components: {},",
                "",
                "    computed: {},",
                "",
                "    beforeMount() {},",
                "",
                "    mounted() {},",
                "",
                "    methods: {},",
                "",
                "    watch: {}",
                "",
                "  }",
                "",
                "</script>",
                "<style lang='' scoped>",
                "",
                "</style>"
            ],
            "description": "Log output to console"
        }
    }
    

    测试方法: 新建vue后缀文件,输入vue,按下tab键,OK

    新建react项目

    vs code中快速创建react项目模板

    1.安装

    到vs扩展工具中找到simple react snippets

    image

    2.使用

    安装好之后,使用其为我们提供的快捷键,我们就可以体验飞一般的体验
    ,快捷键太多,这里举例两种,其他的还需自己根据实际情况查阅使用

    新建号react 的js文件后,输入imrc,按tab键则可以为我们快速引入react
    结果为:import React, { Component } from ‘react’

    输入ccc ,按tab键则可为我们快速生产class模板
    结果为:


    image

    相关文章

      网友评论

        本文标题:vscode新建vue项目和react项目

        本文链接:https://www.haomeiwen.com/subject/pccafktx.html