zCheckboxD.vue 1.5 KB

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