ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
Javascript ``` { // 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" }, "Print to fetch": { "prefix": "fetch", "body": [ "fetch('$1', { credentials: 'include' }).then(x => x.json()).then(x => {", " console.log(x)", "}).catch(err=>{", " console.error(err);", "})", ], "description": "fetch get" }, "Print to fetchP": { "prefix": "fetchP", "body": [ "let headres = {", " method: 'post',", " credentials: 'include',", " headers: {},", " body: {}", "}", "fetch('$1', headres).then(x => x.json()).then(x => {", " console.log(x);", "}).catch(err => {", " console.error(err);", "})" ], "description": "fetch post" }, "Print to fetchf": { "prefix": "fetchf", "body": [ "let dataFrom = new FormData();", "dataFrom.append('', JSON.stringify());", "let headres = {", " method: 'post',", " credentials: 'include',", " headers: {},", " body: dataFrom", "}", "fetch('$1', headres).then(x => x.json()).then(x => {", " console.log(x);", "}).catch(err => {", " console.error(err);", "})" ], "description": "fetch post from" }, "Print to onc": { "prefix": "onc", "body": [ "onClick={() => {", " $1", "}}" ], "description": "onclick" }, } ```