| | |
| | | <template> |
| | | <div class="examination" v-loading="!cardData.length"> |
| | | <div class="examination" v-loading="loading"> |
| | | <div |
| | | v-for="(item, nindex) in cardData" |
| | | :key="nindex" |
| | |
| | | props: { |
| | | cardList: { |
| | | type: Array, |
| | | default: [], |
| | | }, |
| | | primaryColor: { |
| | | type: String, |
| | |
| | | return { |
| | | type: "option", |
| | | loading: false, |
| | | cardData:[] |
| | | cardData:[], |
| | | loading:true |
| | | }; |
| | | }, |
| | | watch:{ |
| | | cardList:{ |
| | | handler(newVal) { |
| | | console.log('11',newVal); |
| | | this.cardData = this.cardList |
| | | if(newVal && newVal.length) { |
| | | this.loading = false |
| | | } |
| | | }, |
| | | deep:true |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.cardData = this.cardList |
| | | console.log('this.cardList',this.cardList); |
| | | console.log('this.cardData',this.cardData); |
| | | // this.cardData = this.cardList |
| | | // console.log('this.cardList',this.cardList); |
| | | // console.log('this.cardData',this.cardData); |
| | | }, |
| | | methods: { |
| | | // 数组转为字符串方法 |
| | |
| | | }, |
| | | // 保存按钮 |
| | | saveAnswer() { |
| | | const element = document.getElementsByClassName("examination")[0]; |
| | | const element = (this.container ? this.container : document |
| | | ).querySelector(".examination"); |
| | | if (element) { |
| | | const pageNum = this.getParentWithClass( |
| | | element, |
| | | "page-box" |
| | | ).getAttribute("page"); |
| | | console.log(this.config.activeBook.name, pageNum); |
| | | const oldAnswerData = localStorage.getItem( |
| | | this.config.activeBook.name + "oldAnswerData" |
| | | ); |