tm-roamer / flowgrid Goto Github PK
View Code? Open in Web Editor NEWflowgrid.js is a plugin for widget layout, 一个轻量简单的网格流布局插件(停止维护)
flowgrid.js is a plugin for widget layout, 一个轻量简单的网格流布局插件(停止维护)
https://github.com/tm-roamer/flowgrid/blob/master/example/base.html#L15
以此demo为例子,在btn-group
增加高度height:300px;
并点击添加多个节点(超过首屏)之后,拖拽下面的元素即可重现。
后发现在此行获取鼠标坐标的方法似乎不恰当 https://github.com/tm-roamer/flowgrid/blob/master/src/dragdrop.js#L52
pageY
是从dom顶部开始计算高度,而应该从浏览器窗口开始计算高度,似乎使用clientY
更合适
在监听dragStart
等事件时vue会抛出一个警告:
[Vue tip]: Event "dragend" is emitted in component <FgContainer> but the handler is registered for "dragEnd".
Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates.
You should probably use "drag-end" instead of "dragEnd".
当前vue版本会将$emit
发出的事件转为小写,html中也不区分大小写,所以vue给出了一个告警,建议将事件名称规范为中划线
格式。
src/fg-container.vue Line31
// fg-layout样式
itemStyle: function () {
let max = this.getMaxRowAndCol();
return {
height: max.row * this.opt.cellH + this.opt.padding.bottom + 'px'
}
这样不会出现纵向滚动条~~~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.