CheckBoxModule.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!-- -->
  2. <template>
  3. <div class="Big-Book-prev-Textdes CheckboxModule" v-if="curQue">
  4. <h2>{{curQue.title}}</h2>
  5. <el-checkbox v-model="curQue.Bookanswer[index]" v-for="(item,index) in curQue.option" :key="index" :readonly="TaskModel=='ANSWER'">{{item.con}}</el-checkbox>
  6. </div>
  7. </template>
  8. <script>
  9. export default {
  10. components: {},
  11. props: ["curQue","TaskModel"],
  12. data() {
  13. return {
  14. userList: []
  15. };
  16. },
  17. computed: {},
  18. watch: {},
  19. //方法集合
  20. methods: {
  21. handleData(){
  22. let _this = this
  23. let userList = []
  24. _this.curQue.option.forEach(item => {
  25. userList.push(false)
  26. });
  27. if (!this.curQue.Bookanswer) {
  28. this.$set(this.curQue, "Bookanswer", userList);
  29. }
  30. }
  31. },
  32. //生命周期 - 创建完成(可以访问当前this实例)
  33. created() {
  34. this.handleData()
  35. },
  36. //生命周期 - 挂载完成(可以访问DOM元素)
  37. mounted() {},
  38. beforeCreate() {}, //生命周期 - 创建之前
  39. beforeMount() {}, //生命周期 - 挂载之前
  40. beforeUpdate() {}, //生命周期 - 更新之前
  41. updated() {}, //生命周期 - 更新之后
  42. beforeDestroy() {}, //生命周期 - 销毁之前
  43. destroyed() {}, //生命周期 - 销毁完成
  44. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  45. };
  46. </script>
  47. <style lang='scss' scoped>
  48. //@import url(); 引入公共css类
  49. .CheckboxModule{
  50. width: 100%;
  51. margin: 0;
  52. h2{
  53. margin: 8px 0;
  54. font-size: 16px;
  55. line-height: 150%;
  56. color: #000000;
  57. }
  58. .el-checkbox{
  59. width: 100%;
  60. margin: 4px 0;
  61. }
  62. }
  63. </style>
  64. <style lang="scss">
  65. .CheckboxModule{
  66. .el-checkbox__label,.el-checkbox__input.is-checked+.el-checkbox__label{
  67. color: #000000;
  68. font-size: 16px;
  69. line-height: 1.5;
  70. font-weight: normal;
  71. }
  72. .el-checkbox__inner{
  73. border-color: #4D91F6;
  74. }
  75. }
  76. </style>