vue 网格布局_Vue.js的可拖动和可调整大小的网格布局

本文介绍了vue-grid-layout,一个基于Vue.js的网格布局系统,类似于Gridster。它支持可拖动和可调整大小的小部件,允许在不重建网格的情况下添加或删除元素,提供布局序列化和自动RTL支持等功能。
摘要由CSDN通过智能技术生成

vue 网格布局

Vue网格布局 (vue-grid-layout)

vue-grid-layout is a grid layout system, like Gridster, for Vue.js. Heavily inspired in React-Grid-Layout

vue-grid-layout是Vue.js的网格布局系统,例如Gridster。 在React-Grid-Layout中大受启发

使用vue-grid-layout的项目 (Projects using vue-grid-layout)

Know of others? Create a PR to let me know!

认识别人吗? 建立公关让我知道!

特征 (Features)

  • Draggable widgets

    可拖动的小部件

  • Resizable widgets

    可调整大小的小部件

  • Bounds checking for dragging and resizing

    边界检查以进行拖动和调整大小

  • Widgets may be added or removed without rebuilding grid

    无需重建网格即可添加或删除小部件

  • Layout can be serialized and restored

    布局可以序列化和还原

  • Automatic RTL support

    自动RTL支持

入门 (Getting Started)

安装 (Installation)

Install the vue-grid-layout package package using npm:

使用npm安装vue-grid-layout 软件包

npm install vue-grid-layout

用法 (Usage)

npm install vue-grid-layout

or include the script in your html (download from releases):

或将脚本包含在html中(从releases下载):

<script src="vue-grid-layout.min.js"></script>
var testLayout = [
	    {"x":0,"y":0,"w":2,"h":2,"i":"0"},
	    {"x":2,"y":0,"w":2,"h":4,"i":"1"},
	    {"x":4,"y":0,"w":2,"h":5,"i":"2"},
	    {"x":6,"y":0,"w":2,"h":3,"i":"3"},
	    {"x":8,"y":0,"w":2,"h":3,"i":"4"},
	    {"x":10,"y":0,"w":2,"h":3,"i":"5"},
	    {"x":0,"y":5,"w":2,"h":5,"i":"6"},
	    {"x":2,"y":5,"w":2,"h":5,"i":"7"},
	    {"x":4,"y":5,"w":2,"h":5,"i":"8"},
	    {"x":6,"y":4,"w":2,"h":4,"i":"9"},
	    {"x":8,"y":4,"w":2,"h":4,"i":"10"},
	    {"x":10,"y":4,"w":2,"h":4,"i":"11"},
	    {"x":0,"y":10,"w":2,"h":5,"i":"12"},
	    {"x":2,"y":10,"w":2,"h":5,"i":"13"},
	    {"x":4,"y":8,"w":2,"h":4,"i":"14"},
	    {"x":6,"y":8,"w":2,"h":4,"i":"15"},
	    {"x":8,"y":10,"w":2,"h":5,"i":"16"},
	    {"x":10,"y":4,"w":2,"h":2,"i":"17"},
	    {"x":0,"y":9,"w"
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值