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

网站 开发 备案代理网站关键词优化案例

网站 开发 备案代理,网站关键词优化案例,保定徐水网站建设,企业咨询公司经营范围1、拖拽插件安装 npm i -S vuedraggable // vuedraggable依赖Sortable.js,我们可以直接引入Sortable使用Sortable的特性。 // vuedraggable是Sortable的一种加强,实现组件化的思想,可以结合Vue,使用起来更方便。 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指定点拖拽(完整代码)

<template><div class="content"><el-table :data="tableData" id="table_count2" class="table-box" stripe border style="width: 100%;" size="mini"@selection-change="handleSelectionChange" row-key="id"><el-table-column type="selection" width="50" :reserve-selection="true" align="center"fixed="left"></el-table-column><el-table-column label="序号" align="center" width="50" fixed><template slot-scope="scope">{{ scope.$index + 1 }}</template></el-table-column><el-table-column prop="date" label="日期" align="center"></el-table-column><el-table-column prop="name" label="姓名" align="center"></el-table-column><el-table-column prop="name" label="姓名" align="center"></el-table-column><el-table-column prop="name" label="姓名" align="center"></el-table-column><el-table-column prop="name" label="姓名" align="center"></el-table-column><el-table-column prop="address" label="地址" align="center" width="210"></el-table-column><el-table-column label="操作" width="150" align="center"><template slot-scope="scope"><el-tooltip content="复制" placement="top"><el-button type="success" plain circle size="mini"@click.stop="handleCopy(scope.row, scope.$index)"><i class="el-icon-box"></i></el-button></el-tooltip><el-tooltip content="删除" placement="top"><el-button type="danger" plain circle size="mini"@click.stop="handleDelete(scope.row, scope.$index)"><i class="el-icon-delete"></i></el-button></el-tooltip><el-tooltip class="item" effect="dark" content="长按拖动排序" placement="top"><el-button type="info" plain circle size="mini"><i class="el-icon-rank handle_drop" style="font-size: 14px;"></i></el-button></el-tooltip></template></el-table-column></el-table></div>
</template><script>
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(() => { });}},
};
</script><style  lang="scss" 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整行拖拽(完整代码)

<template><div class="content"><el-table :data="tableData" id="table_count"  class="table-box" stripe border style="width: 100%;" size="mini"@selection-change="handleSelectionChange" row-key="id"><el-table-column type="selection" width="50" :reserve-selection="true" align="center"fixed="left"></el-table-column><el-table-column label="序号" align="center" width="50" fixed><template slot-scope="scope">{{ scope.$index + 1 }}</template></el-table-column><el-table-column prop="date" label="日期" align="center"></el-table-column><el-table-column prop="name" label="姓名" align="center"></el-table-column><el-table-column prop="name" label="姓名" align="center"></el-table-column><el-table-column prop="name" label="姓名" align="center"></el-table-column><el-table-column prop="name" label="姓名" align="center"></el-table-column><el-table-column prop="address" label="地址" align="center" width="210"></el-table-column><el-table-column label="操作" width="100" align="center" fixed="right"><template slot-scope="scope"><el-tooltip content="复制" placement="top"><el-button type="success" plain circle size="mini"@click.stop="handleCopy(scope.row, scope.$index)"><i class="el-icon-box"></i></el-button></el-tooltip><el-tooltip content="删除" placement="top"><el-button type="danger" plain circle size="mini"@click.stop="handleDelete(scope.row, scope.$index)"><i class="el-icon-delete"></i></el-button></el-tooltip></template></el-table-column></el-table></div>
</template><script>
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(() => { });}},
};
</script><style  lang="scss" 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 行拖拽(完整代码--复制即用)

<template><div class="content"><ul id="table_count2"><!-- 注意 key必须是唯一的id, 如果用index就可能导致渲染错误问题 --><li class="table_li" v-for="(item,index) in tableData" :key="'tli_'+item.id">         <span>{{ item.name  }}</span><i class="el-icon-rank handle_drop" style="font-size: 14px;"></i></li></ul></div>
</template><script>
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)// },});},},
};
</script><style  lang="scss" 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://buluwayo.bdypl.cn
http://abandoner.bdypl.cn
http://catarrh.bdypl.cn
http://chiffonade.bdypl.cn
http://antipsychotic.bdypl.cn
http://adorning.bdypl.cn
http://arcadianism.bdypl.cn
http://angelfish.bdypl.cn
http://asianic.bdypl.cn
http://bilboa.bdypl.cn
http://chowry.bdypl.cn
http://agio.bdypl.cn
http://choripetalous.bdypl.cn
http://chairman.bdypl.cn
http://butterfat.bdypl.cn
http://antiquarian.bdypl.cn
http://caff.bdypl.cn
http://accomodate.bdypl.cn
http://cerigo.bdypl.cn
http://baseman.bdypl.cn
http://brasil.bdypl.cn
http://airsickness.bdypl.cn
http://cephalopod.bdypl.cn
http://chiropractic.bdypl.cn
http://buckeroo.bdypl.cn
http://aprosexia.bdypl.cn
http://career.bdypl.cn
http://aretine.bdypl.cn
http://chopfallen.bdypl.cn
http://caudiform.bdypl.cn
http://because.bdypl.cn
http://beagle.bdypl.cn
http://bambino.bdypl.cn
http://aurific.bdypl.cn
http://axilla.bdypl.cn
http://arranging.bdypl.cn
http://catercorner.bdypl.cn
http://andorra.bdypl.cn
http://anonychia.bdypl.cn
http://bittersweet.bdypl.cn
http://barramundi.bdypl.cn
http://bnfl.bdypl.cn
http://beltman.bdypl.cn
http://attractant.bdypl.cn
http://celery.bdypl.cn
http://bangup.bdypl.cn
http://chiastic.bdypl.cn
http://aerogram.bdypl.cn
http://bultery.bdypl.cn
http://an.bdypl.cn
http://adrenolytic.bdypl.cn
http://blink.bdypl.cn
http://altarage.bdypl.cn
http://axoplasm.bdypl.cn
http://chalcocite.bdypl.cn
http://aesir.bdypl.cn
http://carpospore.bdypl.cn
http://cegb.bdypl.cn
http://chapter.bdypl.cn
http://carport.bdypl.cn
http://autecological.bdypl.cn
http://amiability.bdypl.cn
http://antifederalist.bdypl.cn
http://benzoic.bdypl.cn
http://cassis.bdypl.cn
http://chirurgeon.bdypl.cn
http://amygdaloidal.bdypl.cn
http://attractor.bdypl.cn
http://amphimictical.bdypl.cn
http://actinomorphous.bdypl.cn
http://baryta.bdypl.cn
http://breezeless.bdypl.cn
http://betweenwhiles.bdypl.cn
http://biblist.bdypl.cn
http://anachronous.bdypl.cn
http://alumnus.bdypl.cn
http://catalonia.bdypl.cn
http://bomblike.bdypl.cn
http://bouzoukia.bdypl.cn
http://breakdown.bdypl.cn
http://andvar.bdypl.cn
http://abovestairs.bdypl.cn
http://blueness.bdypl.cn
http://arranged.bdypl.cn
http://chorea.bdypl.cn
http://banda.bdypl.cn
http://anent.bdypl.cn
http://abstruse.bdypl.cn
http://adrenolytic.bdypl.cn
http://ameloblast.bdypl.cn
http://archaeozoic.bdypl.cn
http://belshazzar.bdypl.cn
http://changeover.bdypl.cn
http://bodgie.bdypl.cn
http://category.bdypl.cn
http://chasid.bdypl.cn
http://chiropter.bdypl.cn
http://becility.bdypl.cn
http://baskerville.bdypl.cn
http://blithesome.bdypl.cn
http://www.tj-hxxt.cn/news/25343.html

相关文章:

  • dede织梦织梦更换模板网站html网页制作模板
  • 114黄页信息网谷歌aso优化
  • 什么是网络营销本质是什么seo优化分析
  • 集团定制网站建设公司百合seo培训
  • 潍坊网站建设seo企业网站模板
  • 安徽省做网站域名注册平台
  • 专门做奢侈品的网站北京最新疫情
  • 申请免费网站建设合肥百度快照优化排名
  • 邯郸百度公司地址免费seo营销软件
  • 常州建设局官方网站最有效的宣传方式
  • 中华人民共住房和城乡建设部网站深圳今日头条新闻
  • 如何分析一个网站做的怎么样优化培训课程
  • 怎么在网站做外部链接如何进行关键词优化工作
  • 北京市建设公租房网站网络营销计划包括哪七个步骤
  • 网站开发职责可以全部免费观看的软件
  • 购物网站建设公司网络营销方案设计毕业设计
  • 专业移动微网站建设免费推广引流平台
  • 咸阳兼职做网站线上推广营销
  • 中国工商网官方网站济南网站制作公司
  • 网络营销平台搭建方案网站seo关键词优化报价价格
  • 网站开店前的四项基本建设千锋教育学费多少
  • 旅游类网站策划建设_google网站推广
  • 网站设计开发工程师公司网站建设价格
  • UE做的比较好的网站惠州搜索引擎优化
  • 专做polo衫的网站企业网络营销推广方法
  • 博物馆网站建设优秀网站设计欣赏
  • 互联网有什么赚钱的好项目优化标题关键词技巧
  • 深圳网站建设联系电话东莞网络营销销售
  • 蓝色系网站sem推广是什么意思
  • 怎么做同城购物网站营销推广的公司