Homepage.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <div>
  3. <h1>Sites</h1>
  4. <form>
  5. <field
  6. v-for="field in exampleFields"
  7. :name="field.name"
  8. :minEntries="field.minEntries"
  9. :maxEntries="field.maxEntries"
  10. :initialEntries="field.initialEntries"
  11. :fieldTypes="field.fieldTypes"/>
  12. </form>
  13. </div>
  14. </template>
  15. <script>
  16. import Field from '../components/Field.vue';
  17. export default {
  18. components: { Field },
  19. data: () => {
  20. return {
  21. exampleFields: [
  22. {
  23. name: "Domain",
  24. fieldTypes: [
  25. {
  26. type: "checkbox",
  27. extraButtons: []
  28. },
  29. {
  30. type: "select",
  31. options: [
  32. {
  33. value: "option1",
  34. text: "Option 1"
  35. },
  36. {
  37. value: "option2",
  38. text: "Option 2"
  39. },
  40. {
  41. value: "option3",
  42. text: "Option 3"
  43. }
  44. ]/*,
  45. extraButtons: [
  46. {
  47. icon: "~",
  48. style: "red"
  49. }
  50. ]*/
  51. },
  52. {
  53. type: "text",
  54. extraButtons: [],
  55. fill: true
  56. }
  57. ],
  58. minEntries: 0,
  59. maxEntries: 3,
  60. initialEntries: [
  61. [
  62. true,
  63. "option1",
  64. "Hahaha value"
  65. ]
  66. ]
  67. },
  68. {
  69. name: "Apps",
  70. fieldTypes: [
  71. {
  72. type: "select",
  73. options: [
  74. {
  75. value: "option1",
  76. text: "Option 1"
  77. },
  78. {
  79. value: "option2",
  80. text: "Option 2"
  81. },
  82. {
  83. value: "option3",
  84. text: "Option 3"
  85. }
  86. ]/*,
  87. extraButtons: [
  88. {
  89. icon: "~",
  90. style: "red"
  91. }
  92. ]*/
  93. },
  94. {
  95. type: "text",
  96. extraButtons: [],
  97. fill: true
  98. }
  99. ],
  100. minEntries: 0,
  101. maxEntries: 3,
  102. initialEntries: [
  103. [
  104. true,
  105. "option1",
  106. "Hahaha value"
  107. ]
  108. ]
  109. }
  110. ],
  111. }
  112. },
  113. methods: {
  114. },
  115. mounted() {
  116. }
  117. };
  118. </script>
  119. <style lang="scss" scoped>
  120. form {
  121. width: 400px;
  122. }
  123. </style>