From 1ad2832a6b291e961b3dfc26c80ebb2af64440d1 Mon Sep 17 00:00:00 2001 From: volatile static Date: Sun, 15 Jan 2023 08:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20simple=20snippets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/toolkit.code-snippets | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .vscode/toolkit.code-snippets diff --git a/.vscode/toolkit.code-snippets b/.vscode/toolkit.code-snippets new file mode 100644 index 0000000..74a8941 --- /dev/null +++ b/.vscode/toolkit.code-snippets @@ -0,0 +1,48 @@ +{ + "createElementsFromJSON - full": { + "scope": "javascript,typescript", + "prefix": [ + "createElementsFromJSON" + ], + "body": [ + "createElementsFromJSON(${0:document}, {", + "\ttag: '${1:div}',", + "}, ${16:true});" + ], + "description": "tools/ui/creatElementsFromJSON" + }, + "createElementsFromJSON - minimum": { + "scope": "javascript,typescript", + "prefix": [ + "createElementsFromJSON" + ], + "body": "createElementsFromJSON(document, { tag: '$0' });" + }, + "appendElement - full": { + "scope": "javascript,typescript", + "prefix": "appendElement", + "body": [ + "appendElement({", + "\ttag: '${1:div}',", + "\tid: '${2:id}',", + "\tnamespace: '${3:html}',", + "\tclassList: ['${4:class}'],", + "\tstyles: {${5:style}: '$6'},", + "\tproperties: {},", + "\tattributes: {},", + "\t[{ '${7:onload}', (e: Event) => $8, ${9:false} }],", + "\tcheckExistanceParent: ${10:HTMLElement},", + "\tignoreIfExists: ${11:true},", + "\tskipIfExists: ${12:true},", + "\tremoveIfExists: ${13:true},", + "\tcustomCheck: (doc: Document, options: ElementOptions) => ${14:true},", + "\tchildren: [$15]", + "}, ${16:container});" + ] + }, + "appendElement - minimum": { + "scope": "javascript,typescript", + "prefix": "appendElement", + "body": "appendElement({ tag: '$1' }, $2);" + } +}