当前位置: 首页 > news >正文

vscode设置代码模板

一键生成vue3模板代码

效果演示

输入vue3 显示快捷键 按回车键 一键生成自定义模板
在这里插入图片描述在这里插入图片描述

实现方法

  1. 进入用户代码片段设置
    在这里插入图片描述
  2. 选择片段语言 vue.json在这里插入图片描述
  3. 输入自定义的代码片段
    prefix是触发的内容,按自己的喜好来就行;
    body是模板代码,写入自己需要的就行
{// Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the // same ids are connected.// Example:"create vue3 template": {"prefix": "vue3",  "body": ["<template>","  <div class=\"$1\">$2</div>","</template>","","<script setup>","import { ref, reactive } from 'vue'","</script>","<style  lang='scss' scoped>","$4","</style>"],"description": "create vue3 template"},}

完成!!


一键生成css样式

效果演示

实现方法

  1. 同上
  2. 选择你使用的语言,例如css、scss

在这里插入图片描述3. 输入自定义代码,我这里是设置brr快捷键是border: 1px solid red;

{// Place your snippets for scss here. Each snippet is defined under a snippet name and has a prefix, body and // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the // same ids are connected.// Example:"set a border": {"prefix": "brr","body": ["border: 1px solid red;","$2"],"description": "set a border"}
}

一键输出console.log('$1');

效果演示

在这里插入图片描述

实现方法

  1. 同上
  2. 选择javascript.json
  3. 写入代码
{// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the // same ids are connected.// Example:"Print to console": {"prefix": "cl","body": ["console.log('$1');","$2"],"description": "Log output to console"}
}
http://www.lryc.cn/news/237598.html

相关文章:

  • 用css实现原生form中radio单选框和input的hover已经focus的样式
  • uniapp:录音权限检查,录音功能
  • Rust开发——切片(slice)类型
  • 如何给shopify motion主题的产品系列添加description
  • 力扣刷题-二叉树-二叉树最小深度
  • 注解方式优雅的实现 Redisson 分布式锁
  • PHP/Laravel通过经纬度计算距离获取附近商家
  • grafana面板介绍
  • 实验三 循环结构程序设计(Python)
  • Flutter笔记:目录与文件存储以及在Flutter中的使用(上)
  • 注意了!申请流量卡时地址一定不要填写学校,不好下卡哦!
  • minio使用shell上传文件
  • LeetCode538. Convert BST to Greater Tree
  • iPaaS和RPA,企业自动化应该如何选择?
  • AI实践与学习1_Milvus向量数据库实践与原理分析
  • 3Dexcite deltgen 2022x 新功能
  • 代码随想录算法训练营第六十天 | LeetCode 84. 柱状图中最大的矩形
  • 【2023云栖】陈守元:阿里云开源大数据产品年度发布
  • Element UI 禁用数字输入框组件添加鼠标滚动事件
  • 担忧CentOS停服?KeyarchOS系统来支撑
  • 聚观早报 |联想集团Q2财季业绩;小鹏汽车Q3营收
  • SAP ABAP权限控制中常用TCODE
  • 云计算赛项容器云2023搭建
  • 11.1 文件拷贝移动与删除
  • redhat下使用CentOS yum源,并安装docker
  • 基于单片机体温脉搏检测控制系统及源程序
  • MyBatis-Plus逻辑删@TableLogic
  • 本地私域线上线下 线上和线下的小程序
  • 【前端学java】java中的Object类(8)
  • TensorFlow实战教程(二十六)-什么是生成对抗网络GAN?基础原理和代码普及