vscode会经常用到的代码片段(会定期更新)

vue

  1. {
  2. "Print to vueTemplate": {
  3. "prefix": "vueTemplate",
  4. "body": [
  5. "<template>",
  6. " <div>",
  7. " $3",
  8. " </div>",
  9. "</template>",
  10. "<script>",
  11. "export default {",
  12. " name:'$1',",
  13. " props: {",
  14. " },",
  15. " data() {",
  16. " return {",
  17. " $2",
  18. " }",
  19. " },",
  20. " created() {",
  21. " },",
  22. " mouted() {",
  23. " },",
  24. " methods: {",
  25. " }",
  26. "}",
  27. "</script>",
  28. "<style scoped lang='less'>",
  29. "</style>"
  30. ],
  31. "description": "vue 模板"
  32. }
  33. }

js

  1. {
  2. "Print to jsNoteTitle": {
  3. "prefix": "jsNote",
  4. "body": [
  5. "/**",
  6. " * description: $1",
  7. " * @author: taoxiaolin",
  8. " * @create-date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
  9. " * @version: V $2",
  10. "*/"
  11. ],
  12. "description": "js文件title"
  13. },
  14. "Print to jsfn": {
  15. "prefix": "jsfn",
  16. "body": [
  17. "/**",
  18. " * @function: $1",
  19. " * @description: $2",
  20. " * @author: taoixaolin",
  21. "*/"
  22. ],
  23. "description": "函数注释"
  24. },
  25. "Print to jsModify": {
  26. "prefix": "jsModify",
  27. "body": [
  28. "/**",
  29. " * @description: $1",
  30. " * @modifyContent: $2",
  31. " * @author: taoxiaolin",
  32. " * @modify-date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
  33. "*/"
  34. ],
  35. "description": "修改注明"
  36. },
  37. "Print to console": {
  38. "prefix": "cons",
  39. "body": [
  40. "console.log('$1');",
  41. "$2"
  42. ],
  43. "description": "Log output to console"
  44. }
  45. }

css

  1. {
  2. "Print to cssNote": {
  3. "prefix": "cssNote",
  4. "body": [
  5. "/**",
  6. " * @description: $1",
  7. " * @author: taoxiaolin",
  8. " * @create-date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
  9. "*/"
  10. ],
  11. "description": "css注释"
  12. }
  13. }

less

  1. "Print to lessNote": {
  2. "prefix": "lessNote",
  3. "body": [
  4. "/*",
  5. " *@description: $1",
  6. " *@author: taoxiaolin",
  7. " *@create-date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
  8. "*/"
  9. ],
  10. "description": "less注释"
  11. },
  12. "Print to rem": {
  13. "prefix": "lessRem",
  14. "body": [
  15. "/*",
  16. "---",
  17. "rootSize:$1",
  18. "---",
  19. "*/"
  20. ],
  21. "description": "rem注释"
  22. }