zCheckboxD.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class="zSelect">
  3. <div>
  4. <div class="checkbox">
  5. <van-checkbox-group v-model="zSelectValuec" disabled>
  6. <van-checkbox
  7. :name="item.collectionOptionId + ''"
  8. v-for="(item, index) in zCheckboxcolumns"
  9. :key="index"
  10. shape="square"
  11. >{{ item.collectionOption }}
  12. </van-checkbox>
  13. </van-checkbox-group>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. name: 'zSelect',
  21. props: {
  22. zCheckboxcolumns: [],
  23. checkboxval: '',
  24. textc: '',
  25. rules: false,
  26. answerType: '',
  27. collectionType: '',
  28. level: '',
  29. },
  30. data() {
  31. return {
  32. zSelect: false,
  33. zSelectValuec: '',
  34. };
  35. },
  36. created() {
  37. this.checkboxvalFn();
  38. },
  39. methods: {
  40. checkboxvalFn() {
  41. if (this.checkboxval == '' || this.checkboxval == undefined) {
  42. this.zSelectValuec = [];
  43. } else {
  44. this.zSelectValuec = this.checkboxval.split(',');
  45. }
  46. },
  47. },
  48. };
  49. </script>
  50. <style scoped>
  51. .van-f-red {
  52. color: red;
  53. width: 4px;
  54. display: inline-block;
  55. }
  56. .zSelect .z-cell {
  57. padding: 10px 16px 0 16px;
  58. font-size: 16px;
  59. }
  60. /*.checkbox{padding: 10px 16px 0 16px;background-color: white;}*/
  61. .checkbox .van-checkbox {
  62. padding-bottom: 10px;
  63. }
  64. </style>
  65. <style lang="scss">
  66. .zSelect {
  67. .checkbox .van-checkbox__icon .van-icon {
  68. border: 1px solid #333 !important;
  69. }
  70. .checkbox .van-checkbox__icon--checked .van-icon {
  71. border: 1px solid #1989fa !important;
  72. color: #1989fa;
  73. background-color: #fff;
  74. }
  75. }
  76. </style>