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

做饲料推广哪个网站好企业seo关键字优化

做饲料推广哪个网站好,企业seo关键字优化,平面设计工作室业务范围,弹幕网站开发难么拖拽功能在平时开发中是很常见的,这篇文章主要使用react-beautiful-dnd插件实现此功能。 非常好用,附上GitHub地址:https://github.com/atlassian/react-beautiful-dnd 安装及引入 // 1.引入 # yarn yarn add react-beautiful-dnd# npm npm…

拖拽功能在平时开发中是很常见的,这篇文章主要使用react-beautiful-dnd插件实现此功能。
非常好用,附上GitHub地址:https://github.com/atlassian/react-beautiful-dnd


安装及引入

// 1.引入
# yarn
yarn add react-beautiful-dnd# npm
npm install react-beautiful-dnd --save

具体使用
 

import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd";// 样式相关 代码
const grid = 8;
// 垂直样式
// const getItemStyle = (isDragging, draggableStyle) => ({
//     // some basic styles to make the items look a bit nicer
//     userSelect: "none",
//     padding: grid * 2,
//     margin: `0 0 ${grid}px 0`,
//
//     // change background colour if dragging
//     background: isDragging ? "lightgreen" : "grey",
//
//     // styles we need to apply on draggables
//     ...draggableStyle
// });
// const getListStyle = isDraggingOver => ({
//     background: isDraggingOver ? "lightblue" : "lightgrey",
//     padding: grid,
//     width: 250,
// });// 水平样式
const getItemStyle = (isDragging, draggableStyle) => ({// some basic styles to make the items look a bit niceruserSelect: 'none',padding: grid * 2,margin: `0 ${grid}px 0 0`,// change background colour if draggingbackground: isDragging ? 'lightgreen' : 'grey',// styles we need to apply on draggables...draggableStyle,
});
const getListStyle = isDraggingOver => ({background: isDraggingOver ? 'lightblue' : 'lightgrey',display: 'flex',padding: grid,overflow: 'auto',
});class App extends React.Component {constructor(props) {super(props)this.state = {items: [{id: 'item-0', content: 'hello'},{id: 'item-1', content: 'I'},{id: 'item-2', content: 'am'},{id: 'item-3', content: '卡'},{id: 'item-4', content: '特'},{id: 'item-5', content: '洛'},]};}// a little function to help us with reordering the resultreOrder = (list, startIndex, endIndex) => {const result = Array.from(list);const [removed] = result.splice(startIndex, 1);result.splice(endIndex, 0, removed);return result;};onDragEnd = (result) => {// dropped outside the listif (!result.destination) {return;}const items = this.reOrder(this.state.items,result.source.index,result.destination.index);this.setState({items});}render () {return (<div className="App"><DragDropContext onDragEnd={this.onDragEnd}><Droppable droppableId="droppable" direction="horizontal">{(provided, snapshot) => (<divref={provided.innerRef}style={getListStyle(snapshot.isDraggingOver)}{...provided.droppableProps}>{this.state.items.map((item, index) => (<Draggable key={item.id} draggableId={item.id} index={index}>{(provided, snapshot) => (<divref={provided.innerRef}{...provided.draggableProps}{...provided.dragHandleProps}style={getItemStyle(snapshot.isDragging,provided.draggableProps.style)}>{item.content}</div>)}</Draggable>))}{provided.placeholder}</div>)}</Droppable></DragDropContext></div>);}
}export default App;

说明一下:<Droppable />中的 direction 属性可以控制是水平方向还是垂直方向,配合相关 getItemStyle 和 getListStyle 的代码,可做到。
效果展示

补充一下: 如果你是react-creat-app 创建的项目,则需要删除代码里自带的react 严格模式。否则拖拽效果出不来。

http://www.tj-hxxt.cn/news/114379.html

相关文章:

  • 网站建设 上百度搜索推广怎么做
  • 青岛网站建设网站制作谷歌浏览器下载手机版官网
  • 淘宝网站c 设计怎么做的长沙优化科技
  • 电子商务网站安全性能主要包括企业网络推广
  • 做彩票网站需要代购自媒体平台大全
  • 广州越秀区有疫情吗seo网站优化培
  • 企业网站特点网站建设的系统流程图
  • 做网站搜索结果的代码百度知道app官方下载
  • 高校档案网站建设的目的是什么网络外贸推广
  • 商务网站建设与规划百度统计app
  • 网站开发网站页面2022年度最火关键词
  • 在线做章网站免费域名 网站
  • 网站里网格怎么做深圳整合营销
  • 东阿企业做网站推广海南百度总代理
  • 自己可以做开奖网站吗河北seo基础知识
  • flash型网站网址优化网站平台
  • 珠海市工程造价信息网seo排名影响因素主要有
  • 什么叫网站建设方案书做好网络推广的技巧
  • 哪个网站卖做阳具好点汽车营销策划方案ppt
  • 灵宝网站制作工作室制作链接的小程序
  • 做网站+广告费+步骤百度贴吧网页版入口
  • 做交友网站需要什么免费发帖论坛大全
  • 网站搭建原则html网页制作用什么软件
  • 优秀flash网站设计个人怎么在百度上做推广
  • 网站建设论文 php网络推广费用
  • 宁夏网站建设百度seo快速排名优化服务
  • 主做销售招聘的招聘网站有哪些seo顾问是干什么
  • 自学网站开发多少时间国外seo大神
  • 现在的那家做网站比较好一些呢最近最新的新闻
  • 知识付费网站搭建教程百度关键词优化大师