Socket
Socket
Sign inDemoInstall

v-gantt-chart

Package Overview
Dependencies
11
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.1 to 1.1.2

37

lib/components/dynamic-render.js

@@ -1,6 +0,15 @@

import debounce from "../utils/debounce.js";
let dynamicRender = {
props: {
scrollTop: Number,
scrollTop: {
type: Number,
required: true
},
containerHeight:{
type: Number,
required: true
},
containerWidth:{
type: Number,
required: true
},
cellHeight: {

@@ -18,6 +27,3 @@ type: Number,

showDatas: [],
containerHeight: 960,
containerWidth: 1920,
//去抖
initSize_: "",
// containerHeight: 960,
//两者避免过多的调用sliceData,造成过多的dom操作

@@ -51,21 +57,4 @@ //上一次加载的节点

this.spliceData();
//去抖
this.initSize_ = debounce(this.getContainerSize);
},
mounted() {
this.initSize_();
window.addEventListener('resize',this.initSize_)
this.$once("hook:beforeDestroy", () => {
window.removeEventListener('resize',this.initSize_)
});
},
methods: {
//获取父级容器的高度
getContainerSize() {
let dom = document.querySelector(
".gantt-blocks-wrapper"
)
this.containerHeight = dom.clientHeight;
this.containerWidth = dom.clientWidth;
},
//分割出dom中显示的数据

@@ -72,0 +61,0 @@ spliceData() {

@@ -8,2 +8,3 @@ // gantt.vue写我们的组件

// 方法的第一个参数是传入的Vue,第二个参数可以插件的自定义参数
// eslint-disable-next-line
install (Vue, options) {

@@ -14,4 +15,9 @@ // 将其注册为vue的组件,'gantt'是组件名,keyboard是我们开发的组件

}
// 新增
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(paykeyboard);
}
// 最后将插件导出,并在main.js中通过Vue.use()即可使用插件
export default myPlugin
{
"name": "v-gantt-chart",
"version": "1.1.1",
"version": "1.1.2",
"description": "display gantt-like vaule,like use this to order bus schedule.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -83,7 +83,7 @@ <p align="center"><img src="https://raw.githubusercontent.com/w1301625107/vue-gantt-chart/master/screenshot/icon.png" alt="logo" width="180"></p>

//渲染的数据,有特殊格式 ,目前要求数组中每一个值均为对象,且有gtAarry对象数组这个属性,gtArray中每一个对象需有两个属性,start和end,需为合法的时间字符串.例如
//渲染的数据,有特殊格式 ,目前要求数组中每一个值均为对象,且有gtAarry对象数组这个属性(默认取gtArray,也可以自定义多个数组key值),数组中每一个对象需有两个属性,start和end,需为合法的时间字符串.例如
[
{
id:'test', //非必须
gtArray:[
gtArray:[ //默认的需要渲染的数组的key
{

@@ -94,2 +94,9 @@ name:'test', //非必须

}
],
customKey:[ //自定义的需要渲染的数组的key
{
id:'test', //非必须
start:'2019-01-11 18:18:18',
end:'2019-01-11 18:18:18'
}
]

@@ -125,2 +132,3 @@ }

| datas | ✅ | array | -- | 渲染的数据,有特殊格式 ,目前要求数组中每一个值均为对象,且有gtAarry对象数组这个属性,gtArray中每一个对象需有两个属性,start和end,需为合法的时间字符串.例如```[{id:'test',gtArray:[{start:'2019-01-11 18:18:18',end:'2019-01-11 18:18:18'}]}] ``` 其他不做限制。 |
| arrayKeys| ❌ | array | ["gtArray"] | 需要渲染的数组的key |
| dataKey | ❌ | string | -- | 渲染的每一行的key |

@@ -132,2 +140,3 @@ | itemKey | ❌ | string | -- | 渲染的每一个gantt容器的key |

| scrollToPostion | ❌ | object | -- | 滚动到指定的位置 格式为``` {x:number,y:number}``` |
| hideHeader | ❌ | boolean | false | 隐藏时间轴和表头 |

@@ -159,4 +168,8 @@

## Update
- 支持隐藏表头和时间轴功能
- 支持自定义需要渲染的数组key
- 修改横线滚动越界问题
#### License
_MIT_ ©wuchouchou

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc