当前位置: 首页 > news >正文

网站网站制作开发需要哪些技术论职能网站建设

网站网站制作开发需要哪些技术,论职能网站建设,陕西网络推广维护,用什么网站可以做1、拖拽插件安装 npm i -S vuedraggable // vuedraggable依赖Sortable.js#xff0c;我们可以直接引入Sortable使用Sortable的特性。 // vuedraggable是Sortable的一种加强#xff0c;实现组件化的思想#xff0c;可以结合Vue#xff0c;使用起来更方便。 2、引入拖拽函数… 1、拖拽插件安装 npm i -S vuedraggable // vuedraggable依赖Sortable.js我们可以直接引入Sortable使用Sortable的特性。 // vuedraggable是Sortable的一种加强实现组件化的思想可以结合Vue使用起来更方便。 2、引入拖拽函数 import Sortable from sortablejs //1引入拖拽函数mounted() {this.rowDrop() //2组件创建时执行拖拽方法},// 3拖拽方法rowDrop() {// 要侦听拖拽响应的DOM对象console.log(---rowDrop(拖拽初始化)---)const el document.querySelector(#table_count2 .el-table__body-wrapper tbody);const that this;new Sortable(el, {animation: 150,handle: .handle_drop, //class类名执行事件ghostClass: blue-background-class,// 结束拖拽后的回调函数onEnd({ newIndex, oldIndex }) {console.log(oldIndex, ----拖动到---, newIndex)const tempList [...that.tableData]/**splice 新增删除并以数组的形式返回删除内容此处表示获取删除项对象 */const currentRow tempList.splice(oldIndex, 1)[0];tempList.splice(newIndex, 0, currentRow);/** 在新下标前添加一个数据 第二个参数 0 表示不删除即为新增 */console.log(---新数组---, tempList)that.tableData [...tempList]}// onEnd: (evt) {// console.log(----onEnd(拖拽结束)---, evt)// },});}, 3、el-table指定点拖拽完整代码 templatediv classcontentel-table :datatableData idtable_count2 classtable-box stripe border stylewidth: 100%; sizeminiselection-changehandleSelectionChange row-keyidel-table-column typeselection width50 :reserve-selectiontrue aligncenterfixedleft/el-table-columnel-table-column label序号 aligncenter width50 fixedtemplate slot-scopescope{{ scope.$index 1 }}/template/el-table-columnel-table-column propdate label日期 aligncenter/el-table-columnel-table-column propname label姓名 aligncenter/el-table-columnel-table-column propname label姓名 aligncenter/el-table-columnel-table-column propname label姓名 aligncenter/el-table-columnel-table-column propname label姓名 aligncenter/el-table-columnel-table-column propaddress label地址 aligncenter width210/el-table-columnel-table-column label操作 width150 aligncentertemplate slot-scopescopeel-tooltip content复制 placementtopel-button typesuccess plain circle sizeminiclick.stophandleCopy(scope.row, scope.$index)i classel-icon-box/i/el-button/el-tooltipel-tooltip content删除 placementtopel-button typedanger plain circle sizeminiclick.stophandleDelete(scope.row, scope.$index)i classel-icon-delete/i/el-button/el-tooltipel-tooltip classitem effectdark content长按拖动排序 placementtopel-button typeinfo plain circle sizeminii classel-icon-rank handle_drop stylefont-size: 14px;/i/el-button/el-tooltip/template/el-table-column/el-table/div /templatescript import Sortable from sortablejs //1引入拖拽函数 export default {name: TableBase3,components: {},data() {return {multipleSelection: [],//多选tableData: [{id: 1,date: 2016-05-01,name: 王小虎1,address: 上海市普陀区金沙江路 1510 弄}, {id: 2,date: 2016-05-02,name: 王小虎2,address: 上海市普陀区金沙江路 1511 弄}, {id: 3,date: 2016-05-03,name: 王小虎3,address: 上海市普陀区金沙江路 1512 弄}, {id: 4,date: 2016-05-04,name: 王小虎4,address: 上海市普陀区金沙江路 1513 弄}]}},created() { },mounted() {this.rowDrop() //2组件创建时执行拖拽方法},methods: {// 3拖拽方法rowDrop() {// 要侦听拖拽响应的DOM对象console.log(---rowDrop(拖拽初始化)---)const el document.querySelector(#table_count2 .el-table__body-wrapper tbody);const that this;new Sortable(el, {animation: 150,handle: .handle_drop, //class类名执行事件ghostClass: blue-background-class,// 结束拖拽后的回调函数onEnd({ newIndex, oldIndex }) {console.log(oldIndex, ----拖动到---, newIndex)const tempList [...that.tableData]/**splice 新增删除并以数组的形式返回删除内容此处表示获取删除项对象 */const currentRow tempList.splice(oldIndex, 1)[0];tempList.splice(newIndex, 0, currentRow);/** 在新下标前添加一个数据 第二个参数 0 表示不删除即为新增 */console.log(---新数组---, tempList)that.tableData [...tempList]}// onEnd: (evt) {// console.log(----onEnd(拖拽结束)---, evt)// },});},//多选handleSelectionChange(val) {console.log(----多选 multipleSelection---, val)this.multipleSelection val;},//复制handleCopy(row, rowIndex) {let newList [...this.tableData]let newRow { ...row }newRow[id] newList.length 1newRow[name] newRow[name] - newList.length 1newList.push(newRow)this.tableData [...newList]},//删除handleDelete(row, rowIndex) {this.$modal.confirm(是否确认删除此项, {confirmButtonText: 确定,cancelButtonText: 取消,type: warning,}).then(() {this.tableData.splice(rowIndex, 1)}).catch(() { });}}, }; /scriptstyle langscss scoped ::v-deep {/**el-table表格调整 start*/.el-table .el-table__header-wrapper th,.el-table .el-table__fixed-header-wrapper th {height: auto;padding: 2px 0;}.el-table--mini .el-table__cell {padding: 2px;flex: 1;}/**el-table表格调整 end */ } /style 4、el-table整行拖拽完整代码 templatediv classcontentel-table :datatableData idtable_count classtable-box stripe border stylewidth: 100%; sizeminiselection-changehandleSelectionChange row-keyidel-table-column typeselection width50 :reserve-selectiontrue aligncenterfixedleft/el-table-columnel-table-column label序号 aligncenter width50 fixedtemplate slot-scopescope{{ scope.$index 1 }}/template/el-table-columnel-table-column propdate label日期 aligncenter/el-table-columnel-table-column propname label姓名 aligncenter/el-table-columnel-table-column propname label姓名 aligncenter/el-table-columnel-table-column propname label姓名 aligncenter/el-table-columnel-table-column propname label姓名 aligncenter/el-table-columnel-table-column propaddress label地址 aligncenter width210/el-table-columnel-table-column label操作 width100 aligncenter fixedrighttemplate slot-scopescopeel-tooltip content复制 placementtopel-button typesuccess plain circle sizeminiclick.stophandleCopy(scope.row, scope.$index)i classel-icon-box/i/el-button/el-tooltipel-tooltip content删除 placementtopel-button typedanger plain circle sizeminiclick.stophandleDelete(scope.row, scope.$index)i classel-icon-delete/i/el-button/el-tooltip/template/el-table-column/el-table/div /templatescript import Sortable from sortablejs //1引入拖拽函数 export default {name: TableBase2,components: {},data() {return {multipleSelection: [],//多选tableData: [{id: 1,date: 2016-05-01,name: 王小虎1,address: 上海市普陀区金沙江路 1510 弄}, {id: 2,date: 2016-05-02,name: 王小虎2,address: 上海市普陀区金沙江路 1511 弄}, {id: 3,date: 2016-05-03,name: 王小虎3,address: 上海市普陀区金沙江路 1512 弄}, {id: 4,date: 2016-05-04,name: 王小虎4,address: 上海市普陀区金沙江路 1513 弄}]}},created() { },mounted() {this.rowDrop() //2组件创建时执行拖拽方法},methods: {// 3拖拽方法rowDrop() {// 要侦听拖拽响应的DOM对象console.log(---rowDrop(拖拽初始化)---)const el document.querySelector(#table_count .el-table__body-wrapper tbody);const that this;Sortable.create(el, {// 结束拖拽后的回调函数onEnd({ newIndex, oldIndex }) {console.log(oldIndex, ----拖动到---, newIndex)const tempList [...that.tableData]/**splice 新增删除并以数组的形式返回删除内容此处表示获取删除项对象 */const currentRow tempList.splice(oldIndex, 1)[0];tempList.splice(newIndex, 0, currentRow);/** 在新下标前添加一个数据 第二个参数 0 表示不删除即为新增 */console.log(---新数组---, tempList)that.tableData [...tempList]}// onEnd: (evt) {// console.log(----onEnd(拖拽结束)---, evt)// },})},//多选handleSelectionChange(val) {console.log(----多选 multipleSelection---, val)this.multipleSelection val;},//复制handleCopy(row, rowIndex) {let newList [...this.tableData]let newRow { ...row }newRow[id] newList.length 1newRow[name] newRow[name] - newList.length 1newList.push(newRow)this.tableData [...newList]},//删除handleDelete(row, rowIndex) {this.$modal.confirm(是否确认删除此项, {confirmButtonText: 确定,cancelButtonText: 取消,type: warning,}).then(() {this.tableData.splice(rowIndex, 1)}).catch(() { });}}, }; /scriptstyle langscss scoped ::v-deep {/**el-table表格调整 start*/.el-table .el-table__header-wrapper th,.el-table .el-table__fixed-header-wrapper th {height: auto;padding: 2px 0;}.el-table--mini .el-table__cell {padding: 2px;flex: 1;}/**el-table表格调整 end */ } /style 5、自定义ul li 行拖拽(完整代码--复制即用) templatediv classcontentul idtable_count2!-- 注意 key必须是唯一的id, 如果用index就可能导致渲染错误问题 --li classtable_li v-for(item,index) in tableData :keytli_item.id span{{ item.name }}/spani classel-icon-rank handle_drop stylefont-size: 14px;/i/li/ul/div /templatescript import Sortable from sortablejs //1引入拖拽函数 export default {name: TableBase3,components: {},data() {return {tableData: [{id: 1,date: 2016-05-01,name: 王小虎1,address: 上海市普陀区金沙江路 1510 弄}, {id: 2,date: 2016-05-02,name: 王小虎2,address: 上海市普陀区金沙江路 1511 弄}, {id: 3,date: 2016-05-03,name: 王小虎3,address: 上海市普陀区金沙江路 1512 弄}, {id: 4,date: 2016-05-04,name: 王小虎4,address: 上海市普陀区金沙江路 1513 弄}]}},created() { },mounted() {this.rowDrop() //2组件创建时执行拖拽方法},methods: {// 3拖拽方法rowDrop() {// 要侦听拖拽响应的DOM对象console.log(---rowDrop(拖拽初始化)---)const el document.querySelector(#table_count2);const that this;new Sortable(el, {animation: 150,handle: .handle_drop, //class类名执行事件ghostClass: blue-background-class,// 结束拖拽后的回调函数onEnd({ newIndex, oldIndex }) {console.log(oldIndex, ----拖动到---, newIndex)const tempList [...that.tableData]/**splice 新增删除并以数组的形式返回删除内容此处表示获取删除项对象 */const currentRow tempList.splice(oldIndex, 1)[0];tempList.splice(newIndex, 0, currentRow);/** 在新下标前添加一个数据 第二个参数 0 表示不删除即为新增 */console.log(---新数组---, tempList)that.tableData [...tempList]}// onEnd: (evt) {// console.log(----onEnd(拖拽结束)---, evt)// },});},}, }; /scriptstyle langscss scoped.table_li{width: 500px;padding: 10px;border: 1px solid orange;border-radius: 5px;margin-bottom: 20px;display: flex;align-items: center;justify-content: space-between; } /style 相关文档Element UI table表格行拖动排序_element表格拖拽改变顺序-CSDN博客
http://www.w-s-a.com/news/596627/

相关文章:

  • php商城网站建设多少钱深圳市建设
  • 有什么做糕点的视频网站黄岛做网站
  • 做视频课程网站建设一个普通网站需要多少钱
  • 专做化妆品的网站合肥做网站建设公司
  • 唐山企业网站网站建设费计入那个科目
  • 企业网站制作运营彩虹云主机官网
  • 如何建设废品网站如何在阿里云云服务器上搭建网站
  • 如何建立网站后台程序wordpress 后台管理
  • 山东外贸网站建设怎么样wordpress首页左图右文
  • 志丹网站建设wordpress 形式修改
  • 南通seo网站推广费用网站建设就业前景
  • 自适应网站做mip改造浏览器广告投放
  • 网站meta网页描述网站的推广费用
  • 偃师市住房和城乡建设局网站网站个人主页怎么做
  • 做网站要实名认证吗wordpress去掉仪表盘
  • 在哪做网站好Python建网站的步骤
  • 卢松松的网站办公室设计布局
  • 住房城乡建设干部学院网站织梦网站0day漏洞
  • 企业网站seo优帮云手机桌面布局设计软件
  • 无证做音频网站违法吗智能建站加盟电话
  • 鹿泉专业网站建设做网站为什么要建站点
  • 加强网站建设和维护工作新闻大全
  • 红鱼洞水库建设管理局网站左右左布局网站建设
  • 手机网站建设地址做网站公
  • 贵州建设厅网站首页网络公司除了做网站
  • 运动鞋建设网站前的市场分析wordpress 搜索框代码
  • app开发网站开发教程平台网站开发的税率
  • 百度网站优化排名加强服务保障满足群众急需i
  • 宁夏建设职业技术学院网站安徽网站优化建设
  • 四川关于工程建设网站硬盘做网站空间