首页 > 其他分享 >vxe-table 实现复选框多选,鼠标拖拽选择、鼠标拖拽范围选择

vxe-table 实现复选框多选,鼠标拖拽选择、鼠标拖拽范围选择

时间:2024-11-21 15:41:23浏览次数:1  
标签:鼠标 vxe age 拖拽 role address sex id name

通过 range 启用范围选中,启用后鼠标按住复选框的列,向上或向下滑动选取,支持快捷键;
MouseLeft 按住复选框的列,向上或向下滑动选取;
MouseLeft + Ctrl 局部选取/取消;

<template>
  <div>
    <vxe-table
      border
      height="500"
      :column-config="{resizable: true}"
      :row-config="{isCurrent: true, isHover: true}"
      :data="tableData"
      :checkbox-config="{labelField: 'name', highlight: true, range: true}">
      <vxe-column type="checkbox" title="Name"></vxe-column>
      <vxe-column field="sex" title="Sex"></vxe-column>
      <vxe-column field="age" title="Age"></vxe-column>
      <vxe-column field="address" title="Address" show-overflow></vxe-column>
    </vxe-table>
  </div>
</template>

<script>
export default {
  data () {
    const tableData = [
      { id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', age: 28, address: 'test abc' },
      { id: 10002, name: 'Test2', role: 'Test', sex: 'Women', age: 22, address: 'Guangzhou' },
      { id: 10003, name: 'Test3', role: 'PM', sex: 'Man', age: 32, address: 'Shanghai' },
      { id: 10004, name: 'Test4', role: 'Designer', sex: 'Women', age: 23, address: 'test abc' },
      { id: 10005, name: 'Test5', role: 'Develop', sex: 'Women', age: 30, address: 'Shanghai' },
      { id: 10006, name: 'Test6', role: 'Designer', sex: 'Women', age: 23, address: 'test abc' },
      { id: 10007, name: 'Test7', role: 'PM', sex: 'Women', age: 38, address: 'Shanghai' },
      { id: 10008, name: 'Test8', role: 'Designer', sex: 'Man', age: 24, address: 'test abc' },
      { id: 10009, name: 'Test9', role: 'Test', sex: 'Man', age: 35, address: 'Shanghai' },
      { id: 10010, name: 'Test10', role: 'Develop', sex: 'Women', age: 31, address: 'Shanghai' },
      { id: 10011, name: 'Test11', role: 'PM', sex: 'Women', age: 45, address: 'Shanghai' },
      { id: 10012, name: 'Test12', role: 'Test', sex: 'Man', age: 39, address: 'Guangzhou' },
      { id: 10013, name: 'Test13', role: 'Develop', sex: 'Women', age: 38, address: 'Shanghai' }
    ]
    return {
      tableData
    }
  }
}
</script>

标签:鼠标,vxe,age,拖拽,role,address,sex,id,name
From: https://www.cnblogs.com/qaz666/p/18560919

相关文章

  • vxe-table 表格导出 txt 格式文件
    导出Txt文件打卡txt文件<template><div><vxe-button@click="exportEvent">直接导出Txt文件</vxe-button><vxe-tableshow-footerref="tableRef":export-config="{}":footer-d......
  • vxe-table 表格导出 xml 格式文件
    导出XML文件打开xml文件,部分截图<template><div><vxe-button@click="exportEvent">直接导出XML文件</vxe-button><vxe-tableshow-footerref="tableRef":export-config="{}":foo......
  • vxe-table 集成 echarts 实现单元格图表功能,柱状图、饼图、折线图、右键菜单加载表格
    实现表格通过右键菜单渲染折线图、饼图、柱状图等<template><div><vxe-gridv-bind="gridOptions"@menu-click="menuClickEvent"></vxe-grid></div></template><script>exportdefault{data(......
  • 分享个人在项目中使用过最强的企业级表格、顶级表格控件推荐 vxe-table
    专业的表格控件SpreadJS、ad-grid、vxe-table对比评测,仅对个人实际使用中的开发体验分享、仅供参考做过很多大型项目,ERP、企业内部管理系统,一个系统好不好用基本就是看表格做得好不好了。一般业务的列表页面、增删改查页面、表单页面等。总结实现Excel在线协同功能就选Spr......
  • 分享 vxe-table 实现打印出货单、自定义打印单据
    在公司开发列表时,经常会遇到需求打印出货单,接下来分享如何在vxe-table灵活的使用打印功能,非常简单就能实现能自定义的出货单打印。安装[email protected]@4.9.3//...importVxeUIfrom'vxe-pc-ui'import'vxe-pc-ui/lib/style.css'importVxeUITab......
  • pyautogui模块,PC自动化脚本,控制鼠标
    pyautogui用以操作鼠标,键盘1.鼠标移动importpyautogui#鼠标移动pyautogui.moveTo(x=0,y=0)#鼠标移动,xy对应坐标位置,duration移动所用时间pyautogui.moveTo(x=0,y=0,duration=3)#1920x1080分辨率最大写到分辨率-1,否则报错pyautogui.moveTo(x=1919,y=1079,duration=3......
  • osg三维场景中拾取鼠标在模型表面的点击点
    osg三维场景中拾取鼠标在模型表面的点击点 #include<osg/Group>#include<osg/Geode>#include<osg/ShapeDrawable>#include<osgDB/ReadFile>#include<osgViewer/Viewer>#include<osgGA/GUIEventHandler>#include<osgGA/TrackballManipula......
  • Python从0到100(七十三):Python OpenCV-OpenCV实现手势虚拟拖拽
    前言:零基础学Python:Python从0到100最新最全教程。想做这件事情很久了,这次我更新了自己所写过的所有博客,汇集成了Python从0到100,共一百节课,帮助大家一个月时间里从零基础到学习Python基础语法、Python爬虫、Web开发、计算机视觉、机器学习、神经网络以及人工智能相关知......
  • xtable鼠标划上出提示框
     renderHeader:function(h,{column}){  returnh(   "span",   {    slot:"content",    class:"table-header-flex",   },   [    h(     "el-tooltip",     {     ......
  • Unity实现鼠标框选功能
    usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;usingUnityEngine.UI;publicclassDrawRect:MonoBehaviour{publicstaticDrawRectInstance;publicDrawRect(){Instance=this;}......