vue.code-snippets 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {
  2. "vue component template": {
  3. "prefix": "vcomp",
  4. "body": [
  5. "<script setup lang=\"ts\">",
  6. "interface Props {",
  7. "\t${1}",
  8. "}",
  9. "const props = defineProps<Props>()",
  10. "${2}",
  11. "</script>",
  12. "",
  13. "<template>",
  14. "\t",
  15. "</template>",
  16. "",
  17. "<style lang=\"scss\" scoped>",
  18. "</style>"
  19. ]
  20. },
  21. "vue view template": {
  22. "prefix": "vview",
  23. "body": [
  24. "<script setup lang=\"ts\">",
  25. "import type { BasicForm, ICRUD } from '@/types/form'",
  26. "import { ${0} } from '@/api/'",
  27. "",
  28. "const CRUD: ICRUD = {",
  29. "\tcreate(data) {",
  30. "\t\t",
  31. "\t},",
  32. "\tupdate(data) {",
  33. "\t\t",
  34. "\t},",
  35. "\tgetList(data) {",
  36. "\t\t",
  37. "\t},",
  38. "\tdelete(data) {",
  39. "\t\t",
  40. "\t}",
  41. "}",
  42. "const formConfig = reactive<BasicForm>({",
  43. "\tformItems: []",
  44. "})",
  45. "</script>",
  46. "",
  47. "<template>",
  48. "\t<pro-table :crud=\"CRUD\" :formConfig=\"formConfig\">",
  49. "\t\t<vxe-column field=\"\" title=\"\"></vxe-column>",
  50. "\t</pro-table>",
  51. "</template>",
  52. "",
  53. "<style lang=\"scss\" scoped>",
  54. "</style>"
  55. ]
  56. },
  57. "vue api template": {
  58. "prefix": "vapi",
  59. "body": [
  60. "import request from '@/utils/request'",
  61. "",
  62. "export function get${0}(data?: any) {",
  63. "\treturn request.get('/sys/', data)",
  64. "}",
  65. "export function save${0}(data: any) {",
  66. "\treturn request.post('/sys/', data)",
  67. "}",
  68. "export function delete${0}(data: any) {",
  69. "\treturn request.get('/sys/', data)",
  70. "}",
  71. ]
  72. },
  73. }