当前位置: 首页 > 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.zhongyajixie.com/news/60877.html

相关文章:

  • 网站用什么语言软文营销步骤
  • 优秀的个人网站设计网站免费优化
  • 哪家网站专门做折扣销售广州排前三的seo公司
  • 上海做淘宝网站建设搜索引擎关键词优化
  • 企业网站傻瓜搭建品牌宣传有哪些途径
  • 网站颜色搭配网站百度一下你就知道官网网址
  • 学做网页的网站黄页引流推广
  • 建设工程人员押证在哪个网站查网址搜索ip地址
  • 动态网站建设试题网站开发的一般流程
  • 临沂免费模板建站广州seo排名优化公司
  • 网站建设中图片电话微信群免费推广平台
  • 比汉斯设计网站behance做一个网站需要什么
  • 怎样做能直接上传微信的视频网站公司网站设计哪家好
  • 如何做分享赚钱的网站电商网店
  • 手机app网站建设科技公司网站制作公司
  • dw个人网页设计郑州优化公司有哪些
  • 谷歌做不做网站网站seo入门基础教程书籍
  • 怎么用ps做网站首页百度教育网站
  • 哪家公司做跳转网站谷歌搜索指数查询
  • 定制杯子seo的搜索排名影响因素有
  • 济南网站建设 力选聚搜网络网站推广方案
  • jsp新闻网站网页制作免费网站制作
  • 怎么做淘宝优惠券网站清远新闻最新消息
  • 婚纱照网站制作软文营销怎么做
  • 金蝶软件仓库管理sem推广和seo的区别
  • 青岛网站营销推广企业如何建站
  • 网站域名备案查询官网百度关键词搜索技巧
  • 网站建设行业数据企业广告宣传
  • 东阿做网站推广seo站长工具综合查询
  • wordpress接入微信支付网站 seo