programing

Vue Js 단락이 -> OK로 표시되지만 체크박스가 작동하지 않음

prostudy 2022. 6. 22. 21:38
반응형

Vue Js 단락이 -> OK로 표시되지만 체크박스가 작동하지 않음

POST API의 3번째 버전입니다.
api에 됩니다.

하면:
// 2 {{answer1}} // 표시 2
// 1 {{answer2}} // 1 ★★
// 3 03} : // 0 표 {{

하지만 처음 시작할 때는 체크박스가 작동하지 않지만 문서를 저장했다가 다시 저장하면 해당 체크박스가 작동합니다.

<el-checkbox v-model="...." :disabled="answer1 > 0 ?'false':'true'" ></el-checkbox>

my mounted call api :

async mounted(){

 await this.actionSetanswer1({
            props1: '..',
            props2: '..',
        }).then(() => {
            this.actionSetanswer2({
                props1: '...',
                props2: '...',
            }).then(() => {
                this.actionSetanswer3({
                    props1: '...',
                    props2: '...',
                })
            })
        })
}

NB: 이것을 미리 감사드립니다.$forceUpdate()도 동작하지 않습니다.

로드 상태를 추가할 수 있습니다.

// script
data() {
  return {
    isLoading: true
  }
},
mounted() {
  // ...
  .then(() => {
    this.actionSetanswer3({
       props1: '...',
       props2: '...',
    }).then(() => {
       this.isLoading = false
    })
}
// template
<el-checkbox v-if="!isLoading" v-model="...." :disabled="answer1 > 0 ?'false':'true'" />

언급URL : https://stackoverflow.com/questions/68951335/vue-js-paragraph-display-ok-but-checkbox-doesnt-works

반응형