Files
owl/tools/owl-vision/snippets/component.json
T

44 lines
1.4 KiB
JSON
Raw Normal View History

{
2024-03-14 11:27:45 +01:00
"Basic OWL Component": {
"prefix": "owlcomponent",
2024-03-14 11:27:45 +01:00
"scope": "javascript,typescript",
"body": [
2024-03-14 11:27:45 +01:00
"import { Component } from \"@odoo/owl\";",
"",
"class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} extends ${2:Component} {",
"",
" static template = \"${3:${RELATIVE_FILEPATH/(.*[\\|\\/])??([a-zA-Z_]+)([\\|\\/]static[\\|\\/].*)/${2}/g}}.${4:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}}\";",
" static components = {};",
" static props = {};",
"",
" setup() {",
2024-03-14 11:27:45 +01:00
" ${5:super.setup();}",
" }",
2024-03-14 11:27:45 +01:00
"",
" ${6:// Do Something}",
"}",
""
2024-03-14 11:27:45 +01:00
],
"description": "The starting base for an owl component"
2024-03-14 11:27:45 +01:00
},
"Basic OWL Template": {
"prefix": "owltemplate",
"scope": "xml",
"body": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>",
"",
"<templates xml:space=\"preserve\">",
"",
" <t t-name=\"${2:${RELATIVE_FILEPATH/(.*[\\|\\/])??([a-zA-Z_]+)([\\|\\/]static[\\|\\/].*)/${2}/g}}.${3:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}}\">",
" ${3:<h1>Hello World</h1>}",
" </t>",
"",
"</templates>",
""
],
"description": "Generate a basic OWL template XML file"
}
}