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

珠海网站建设厚瑜app推广多少钱一单

珠海网站建设厚瑜,app推广多少钱一单,智慧团建登录手机版入口,微信怎么开店铺简述 作为一名前端开发人员,在工作中难免会遇到拖拽功能,分享一个github上一个不错的拖拽js库,能满足我们在项目开发中的需要,支持Vue和React,下面是SortableJS的使用详细; 这个是sortableJS中文官方文档&…

简述

作为一名前端开发人员,在工作中难免会遇到拖拽功能,分享一个github上一个不错的拖拽js库,能满足我们在项目开发中的需要,支持VueReact,下面是SortableJS的使用详细;

 

这个是sortableJS中文官方文档,记录了一些相关属性和使用方法,页面十分简约方便阅读;

SortableJs中文文档http://www.sortablejs.com

下面是使用详细,主要分为3步;

1、首相需要安装相关依赖:npm install sortablejs --save;

2、页面引入使用:import Sortable from "sortablejs";

3、获取大盒子属性,然后在初始化的使用需要调用Sortable.create()方法;

 

vue页面使用;

<template><div class="sortable"><div id="container" ref="sortableBox"><div v-for="(item, index) in arr" :key="item"><span>{{ item }}</span></div></div></div>
</template><script>
import Sortable from "sortablejs";
export default {name: "CodeDemoSortable",data() {return {arr: ["one", "two", "three", "four"],};},mounted() {this.defineSortable();},methods: {defineSortable() {this.$nextTick(() => {const el = this.$refs.sortableBox;// 或则使用// const el = document.getElementById("container");Sortable.create(el, {animation: 200,//拖拽动画过渡时间group: "name",sort: true,});});},},
};
</script><style lang="scss" scoped>
.sortable {#container {width: 600px;height: 300px;margin: 50px auto;background-color: skyblue;padding: 20px;box-sizing: border-box;display: flex;flex-direction: column;justify-content: space-around;div {height: 20%;text-align: center;line-height: 50px;width: 100%;background-color: plum;}}
}
</style>

 

html页面使用;

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.container {width: 600px;height: 300px;margin: 50px auto;background-color: skyblue;padding: 20px;box-sizing: border-box;display: flex;flex-direction: column;justify-content: space-around;}.container>div {height: 20%;text-align: center;line-height: 52px;width: 100%;background-color: plum;}</style>
</head><body><div class="container"><div>one</div><div>two</div><div>three</div></div><!-- 引入js文件,也可以把js文件下载到本地使用 --><script src="https://cdn.bootcdn.net/ajax/libs/Sortable/1.15.0/Sortable.min.js"></script><script>const el = document.querySelector('.container')// 初始化var sortable = Sortable.create(el, {animation: 200,//拖拽动画过渡时间group: "name",sort: true});</script>
</body></html>

 

效果图如下:

2fff1f879b4e40cba11b027ff70a8807.gif

 

感觉有用,就一键三连,感谢(●'◡'●)

 

http://www.mnyf.cn/news/40350.html

相关文章:

  • 自己做网站做淘宝客深圳百度推广公司
  • 有哪些用flex做的网站在哪里可以发布自己的广告
  • 网站做京东联盟电商运营转行后悔了
  • 成人网站vps企业网络营销成功案例
  • 唐山网站建设优化ping站长工具
  • 豪车网站建设背景福州seo代理计费
  • 公司网站在哪里做网站营销与推广
  • 中江建设银行网站seo优化排名营销
  • 福州网站制作外包0元做游戏代理
  • 微信文章转网站wordpress宁波seo外包优化
  • 中山网络公关北京关键词优化服务
  • 在哪些网站做兼职比较可靠日本进口yamawa
  • 360云盘做服务器建设网站最近的新闻摘抄
  • 福田网络推广公司四年级下册数学优化设计答案
  • php网站建设与维护百度电脑版下载安装
  • 网站制作公司深圳seo的培训课程
  • 孝感专业做网站公司seo搜索引擎优化求职简历
  • 网站 备案 初审百度霸屏推广多少钱一个月
  • 网络营销类型江北关键词优化排名seo
  • 淘宝里面的网站怎么做的应用宝aso优化
  • 织梦做的网站删除企业站seo报价
  • h5建站是什么优化网站打开速度
  • 做国外直播网站最新军事战争新闻消息
  • 深圳便宜做网站北京网络优化推广公司
  • 网站解封原因惠州网络营销公司
  • 做视频教学网站如何做自己怎么做网页推广
  • 香港网站建设 深圳分公司广告招商
  • 宁波汽车网站建设杭州网站优化平台
  • 网站建设近义词成全高清免费观看mv
  • 哪个网站可以做立体字的模板网站排名优化首页