Vuejs2 具有拖动功能的表格(鼠标向下/mouseup)

Vuejs2 具有拖动功能的表格(鼠标向下/mouseup),vuejs2,mouseevent,Vuejs2,Mouseevent,我不知道如何通过mousedown和mouseup事件选择(更改背景)和更新表单元格中的值(将选定单元格的值设置为“X”)。大概是这样的: 到目前为止,我得到的是: <template> <div class="container"> <table border="1"> <thead> <tr>

我不知道如何通过mousedown和mouseup事件选择(更改背景)和更新表单元格中的值(将选定单元格的值设置为“X”)。大概是这样的:

到目前为止,我得到的是:

<template>
    <div class="container">
        <table border="1">
            <thead>
                <tr>
                    <th>Day/Time</th>
                    <th v-for="day in days" width="60" :key="day">Day {{ day }}</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(item, indexRow) in itemList" :key="indexRow">
                    <td>{{ item.name }}</td>
                    <td v-for="(day, indexColumn) in days" :key="indexColumn" v-on:mousedown="onMouseDown(indexRow, indexColumn)" v-on:mouseup="onMouseUp(indexRow, indexColumn)">Click</td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script>
    export default {
        name: 'Overview',
        data() {
            return {
                days: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
                itemList: [ { name: 'Marshall'  }, { name: 'Rocky' }, { name: 'Skye' } ]
            }
        },
        methods: {
            onMouseDown(x, y) {
                console.log('mouse down X: ' + x + ' Y:' + y);
            },
            onMouseUp(x, y) {
                console.log('mouse up X: ' + x + ' Y:' + y);
            }
        }
    }
</script>

天/时间
第{{Day}
{{item.name}
点击
导出默认值{
名称:“概述”,
数据(){
返回{
天数:[1,2,3,4,5,6,7,8,9,10],
项目列表:[{name:'Marshall'},{name:'Rocky'},{name:'Skye'}]
}
},
方法:{
onMouseDown(x,y){
log('mouse down X:'+X+'Y:'+Y));
},
onMouseUp(x,y){
log('mouse up X:'+X+'Y:'+Y));
}
}
}
有人能分享他的想法吗

提前谢谢