关于vscode插件:前端提升开发效率之vsCode-快速生成自定义模板

43次阅读

共计 635 个字符,预计需要花费 2 分钟才能阅读完成。

1. 装置 vsCode

  1. 下载地址:https://code.visualstudio.com/

装置实现后 启动 vsCode , 此处省略 一万字 ….

2. 唤出 vsCode 控制台

Windows 快捷键 : Ctrl + Shift + P

macOS 快捷键 : command + Shift + P

3. 输出“snippets”并抉择

4. 如下有许多代码片段 进行自定义编写

5. 咱们以 vue 文件 进行演示(输出 vue)抉择 vue.json

6. vsCode 主动 生成 vue.json 文件 如下

7. 将 vue.json 文件 改为如下配置(可依据集体需要进行批改模板内容)

{
    "Print to console": {
        "prefix": "vue",
        "body": [
                "<template>",
                "<div></div>",
                "</template>",
                "","<script>","export default {","  components: {},","  props: {},","  data() {","    return {","};","  },","  watch: {},","  computed: {},","  methods: {},","  created() {},","  mounted() {}","};","</script>","<style lang=\"scss\" scoped>","</style>"],"description":"A vue file template"
    }
}

8. 在我的项目中 新建一个 vue 文件 输出“vue”按下回车键或者 Tab 键,模板就主动生成了

正文完
 0