component.scheme.js 831 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. export const propsScheme = {
  2. modelValue: {
  3. type: [String, Object],
  4. intro: '展示的代码'
  5. },
  6. readonly: {
  7. type: [Boolean, String],
  8. intro: 'nocursor: readonly状态并且不展示光标',
  9. options: [false, true, 'nocursor'],
  10. default: false,
  11. validate: true
  12. },
  13. type: {
  14. type: String,
  15. default: 'json'
  16. },
  17. mode: {
  18. type: String
  19. },
  20. height: {
  21. type: String,
  22. intro: '代码编辑器高度',
  23. default: 'auto'
  24. },
  25. theme: {
  26. type: String,
  27. intro: '主题,需要额外引入',
  28. default: 'dracula'
  29. },
  30. lineNumbers: {
  31. type: Boolean,
  32. default: true
  33. },
  34. indentUnit: {
  35. type: Number,
  36. default: 4
  37. }
  38. }
  39. export const eventsScheme = {
  40. 'update:modelValue': {
  41. cbVar: 'value'
  42. }
  43. }
  44. export const componentScheme = {
  45. propsScheme,
  46. eventsScheme
  47. }