programing

vue-disable을 사용하지 않도록 설정할 수 없음

prostudy 2022. 7. 18. 22:06
반응형

vue-disable을 사용하지 않도록 설정할 수 없음

어플리케이션 전체에서 공유되는 컴포넌트를 작성했습니다.드래그/소팅이 필요한 장소와 원하지 않는 장소도 있습니다.A에 합격했습니다.prop내 컴포넌트인disableDraggable그리고 그것을 바탕으로 아무것도 할 수 없습니다.드래거블을 비활성화하려면 어떻게 해야 하나요?Options 객체의 구문과 간단한 구문을 모두 사용해 보았습니다.:disable관련 코드는 다음과 같습니다.

 <draggable v-model="copyOfQuestions" @end="$emit('updateQuestionsOrder', copyOfQuestions)" :options="{disable : disableDraggable}">  
// or :disable="disableDraggable"
      <v-card flat class="list_outer_block" v-for="q in questions" :key="q.question_id">
        <v-card-text class="pa-0">

          <v-layout justify-start align-center>
            <v-flex initial-xs px-2 py-3 class="handle minwdth-0" :title="$t('general.drag_for_reorder')">
              <v-icon class="text--secondary  text--lighten-3">$vuetify.icons.drag_indicator</v-icon>
            </v-flex>
    ....
        props: ['questions', 'disableDraggable'],

드래그 가능 기능을 비활성화하려면 어떻게 해야 합니까?

주의할 점은vue-draggable(사용하고 있는 것은)와 같은 API를 가지고 있다고 생각됩니다.SortableJs

:disabled로 하고 NOT :disable로 해야 합니다.

 <draggable v-model="copyOfQuestions" @end="$emit('updateQuestionsOrder', copyOfQuestions)" :options="{disabled : disableDraggable}">  

레퍼런스:
https://github.com/SortableJS/Vue.Draggable/blob/17bdd4b8b2ab4f4df45dd76edf1afec864ec0936/example/debug-components/slot-example.vue

언급URL : https://stackoverflow.com/questions/57179289/vue-draggable-not-able-to-disable

반응형