반응형
<template>
<div :class="[`notice drag${index}`]"
v-for="(item, i) in modalList"
@click="dragstart(index)"
@mousedown="mousedown">
</div>
</template>
<script>
let zIndex = 9100;
export default {
data() {
return {
modalList : [],
noticeNum: '',
};
},
methods: {
dragstart(index){
this.noticeNum = index;
zIndex++;
},
mousedown(){
let notice = document.querySelector([`.drag${this.noticeNum}`]);
notice.style.cursor = 'grabbing';
notice.style.zIndex = zIndex;
},
},
};
</script>
<style lang="scss" scoped></style>
반응형
'실무 > vue.js 실무 기능' 카테고리의 다른 글
12. email validation 체크 만들기 (0) | 2023.01.18 |
---|---|
11. vue로 Modal창, Modal Drag 구현 | v-for, v-if (0) | 2023.01.15 |
9. [vue-js-modal] Modal | vue.js 모달 드래그 (0) | 2023.01.01 |
8. vue.js | window.open() 으로 Popup 만들기 (0) | 2022.11.22 |
7. jodit-vue 에디터 사용방법 (0) | 2022.11.15 |