npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rabkit/x-gantt-elastic

v0.0.4

Published

> 方便快速构建、启动项目工程

Downloads

7

Readme

x-gantt-elastic

方便快速构建、启动项目工程

开始

运行当前项目需要环境: node >= 16, pnpm, python2.

对于 windows, 还需要安装 msbuild tools 2017.

安装

# install dependencies
pnpm install

# serve with hot reload at localhost:8080
pnpm serve

打包

# build packages/
pnpm lib

# publish packages/
pnpm publish --access public

开发

使用

  1. 引入
// 组件内按需引入
<script>
import { GanttElastic } from "@rabkit/x-gantt-elastic"
export default {
  components: { GanttElastic }
}
</script>
// main.js 中全量引入
import GanttElasticPlugin from "@rabkit/x-gantt-elastic"
Vue.use(GanttElasticPlugin)
  1. 组件
<gantt-elastic
  :options="options"
  :tasks="tasks"
  :dynamic-style="dynamicStyle"
  @tasks-changed="tasksUpdate"
  @options-changed="optionsUpdate"
  @dynamic-style-changed="styleUpdate"
>
  <template slot="header"></template>
  <template slot="footer"></template>
</gantt-elastic>
  1. 参数

| 字段 | 类型 | 默认值 | | ------------- | ------ | ------ | | tasks | Array | [] | | | | | | options | Object | | | - taskMapping | Object | {} | | - maxRows | Number | 100 | | - maxHeight | Number | 900 | | - columns | Array | [] | | - locale | Object | {} | | | | | | dynamic-style | Object | {} |

  1. 方法

| 方法 | 描述 | 返回值 | | --------------------- | -------------- | ------- | | tasks-changed | 任务项发生改变 | tasks | | options-changed | 配置项发生改变 | options | | dynamic-style-changed | 样式组发生改变 | style |

  1. 插槽

| 插槽 | 描述 | | ------ | -------------- | | header | 甘特图头部插槽 | | footer | 甘特图尾部插槽 |

除了 headerfooter两个固定插槽,还提供了表格每一列的插槽,使用方法如下:

// 确定 tasks 的数据,此时需要自定义 uuid_task_name 这个字段的组件插槽
const tasks = [
  {
    id: 'uuid_001',
    uuid_task_name: '任务为 1',
    percent: 85,
    type: 'task'
  }
]
// 定义 options 中的 columns
const options = {
  taskMapping: {
    label: 'uuid_task_name'
  },
  columns: [
    {
      id: 'uuid_task_name',
      label: '任务详情',
      value: 'uuid_task_name',
      display: true,
      customSlot: 'uuid_task_name'
    }
  ]
}

然后就可以通过以下方式来设置每一行的该字段组件插槽了

<gantt-elastic
  :options="options"
  :tasks="tasks"
>
  <template v-slot:uuid_planned_start="scopeSlot">
    <div>
      {{ scopeSlot.row.uuid_planned_start }}
    </div>
  </template>
</gantt-elastic>