用户代码段

文件–>首选项—>用户代码段
vue.json文件

{
	// 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:
	// "Print to console": {
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }

"Print to console": {
		"prefix": "sc",
		"body": [
			"<template>",
			" ",
			" ",
			"</template>",
			
			"<script>",
			"export default {",
				" ",
				" ",
			"}",
			"</script>",
			
			"<style>",
			" ",
			" ",
			"</style>"
		],
		"description": "Log output to console"
	}








}

javascript.json

{
	
	
	// 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": "log",
		"body": [
			"console.log('$1');",
		],
		"description": "Log output to console"
	},
	"jquery to ajax": {
		"prefix": "ajax",
		"body": [
			"$.ajax({",
				"url:'',",
				"type:'get',",
				"dataType:'json',",
				"data:'',",
				"success: function(data){",
				"}",
			"});"
		],
		"description": "ajax请求"
	},
	"form to ajax": {
		"prefix": "form-ajax",
		"body": [
			"$('#form').on('submit',function(e){",
				"//禁用表单默认提交事件",
				"e.preventDefault();",
				"$.ajax({",
					"url:'',",
					"type:'get',",
					"dataType:'json',",
					"data:'',",
					"success: function(data){",
					"}",
				"});",
			"});"
			
		],
		"description": "表单提交ajax请求"
	},
	"express-server": {
		"prefix": "express",
		"body": [
			"//1.导入模块",
			"const express = require('express');",
			"//2.创建服务器",
			"let app = express();",
			"//3.开启服务器",
			"app.listen(3000,()=>{",
				"console.log('success');",
			"});"
		],
		"description": "快速搭建express服务器"
	},
	"get element by id": {
		"prefix": "gid",
		"body": [
			"var box = document.getElementById('box')",
		],
		"description": "根据id获取元素"
	},
	"enmu arr": {
		"prefix": "forin",
		"body": [
			"for(var i = 0;i<arr.length;i++){",
				"console.log(arr[i]);",
			"}",
		],
		"description": "数组快速for循环遍历"
	},
	"get elment by tagname": {
		"prefix": "gtn",
		"body": [
			"var liList = document.getElementsByTagName('li')",
		],
		"description": "根据标签名获取元素"
	},
	"get elment by classname": {
		"prefix": "gcn",
		"body": [
			"var oneList = document.getElementsByClassName('one')",
		],
		"description": "根据类名获取元素"
	},
	"quick event": {
		"prefix": "click",
		"body": [
			"//注册事件",
			"box.onclick = function(){}",
		],
		"description": "快速注册点击事件"
	},
	"需求分析": {
		"prefix": "silu1",
		"body": [
			"/*", 
				"1.分析需求(交互):",
				"2.思路分析(事件三要素)",
							"获取元素:事件源:",
						"注册事件:事件类型",
						"事件处理:",
			 "*/",
		],
		"description": "分析需求"
	},
	"根据思路实现需求": {
		"prefix": "silu2",
		"body": [
			"//1.获取元素",
			"var box = document.getElementById('box');",
			"//2.注册事件",
			"box.onclick = function () {",
				"//3.事件处理:",
			"};",
		],
		"description": "根据思路实现需求"
	},
	

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值