vue3.code-snippets 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {
  2. // Place your unibest 工作区 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
  3. // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
  4. // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
  5. // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
  6. // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
  7. // Placeholders with the same ids are connected.
  8. // Example:
  9. // "Print to console": {
  10. // "scope": "javascript,typescript",
  11. // "prefix": "log",
  12. // "body": [
  13. // "console.log('$1');",
  14. // "$2"
  15. // ],
  16. // "description": "Log output to console"
  17. // }
  18. "Print unibest Vue3 SFC": {
  19. "scope": "vue",
  20. "prefix": "v3",
  21. "body": [
  22. "<route lang=\"json5\" type=\"page\">",
  23. "{",
  24. " style: { navigationBarTitleText: '$1' },",
  25. "}",
  26. "</route>\n",
  27. "<template>",
  28. " <view class=\"\">$2</view>",
  29. "</template>\n",
  30. "<script lang=\"ts\" setup>",
  31. "//$3",
  32. "</script>\n",
  33. "<style lang=\"scss\" scoped>",
  34. "//",
  35. "</style>\n",
  36. ],
  37. },
  38. "Print unibest style": {
  39. "scope": "vue",
  40. "prefix": "st",
  41. "body": ["<style lang=\"scss\" scoped>", "//", "</style>\n"],
  42. },
  43. "Print unibest script": {
  44. "scope": "vue",
  45. "prefix": "sc",
  46. "body": ["<script lang=\"ts\" setup>", "//$3", "</script>\n"],
  47. },
  48. "Print unibest template": {
  49. "scope": "vue",
  50. "prefix": "te",
  51. "body": ["<template>", " <view class=\"\">$1</view>", "</template>\n"],
  52. },
  53. }