@braks/vue-flow

中文文档
0.4.41发布于 2022/10/08MITTypeScriptESM + CJS近 30 天下载 3574

Vue flow top-language vulnerabilities ![GitHub code size in bytes](ht

此软件包已被标记为弃用

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

原始使用文档
文档目录11 节
  1. Table of contents
  2. ⭐️ Features
  3. 🛠 Setup
  4. 🎮 Quickstart
  5. 🪴 Vue 2
  6. 🧪 Development
  7. Prerequisites
  8. 🐳 Dev Container
  9. Discord
  10. 💝 Special Thanks
  11. ⭐ Stargazers

Vue Flow 🌊

Vue flow top-language vulnerabilities GitHub code size in bytes GitHub last commit

Vue Flow: A highly customizable Vue 3 Flowchart component.

With Vue Flow, you can build your own, customized node-based applications like static diagrams or even more complex and interactive editors!

You can find a detailed explanation of how to get started in the documentation or check the examples.

Table of contents

⭐️ Features

  • 👶 Easy setup: Get started hassle-free - Built-in zoom- & pan features, element dragging, selection and much more

  • 🎨 Customizable: Use your custom nodes, edges and connection lines and expand on Vue Flows' functionality

  • 🚀 Fast: Tracks changes reactively and only re-renders the appropriate elements

  • 🧲 Utils & Composition: Comes with graph helper and state composable functions for advanced uses

  • 📦 Additional Components:

    • 🖼 Background: With two built-in patterns and some configuration options like height, width or color.

    • 🧭 Minimap: Shows current nodes in a small map shape in the bottom right corner

    • 🕹 Controls: Control zoom behavior from a panel on the bottom left

    • 🤖 And (many) more to come...

  • 🦾 Reliable: Fully written in TypeScript

🛠 Setup

$ npm i @braks/vue-flow

# or
$ yarn add @braks/vue-flow

🎮 Quickstart

A flow consists of nodes and edges (or just nodes). Together they are called elements.

Each element needs a unique id.

A node also needs an XY position. An edge needs a source (node id) and a target (node id).

A basic setup looks like this:

<!-- Flowchart.vue -->
<script setup>
import { VueFlow } from '@braks/vue-flow'

const elements = ref([
  {
    id: '1',
    label: 'node 1',
    position: { x: 100, y: 100 },
  },
  {
    id: '2',
    label: 'node 2',
    position: { x: 100, y: 200 },
  },
  {
    id: 'e1-2',
    target: '2',
    source: '1',
  },
])
</script>

<template>
  <VueFlow v-model="elements"></VueFlow>
</template>

⚠️ Make sure to import the necessary styles:

/* import the required styles */
@import "@braks/vue-flow/dist/style.css";

/* import the default theme (optional) */
@import "@braks/vue-flow/dist/theme-default.css";

🪴 Vue 2

This library doesn't work with Vue 2.

Vue Flow uses features that are exclusive to Vue 3, therefore there is no support for Vue 2, nor will there be any support in the future, sorry.

🧪 Development

Prerequisites

# skip if you already have pnpm installed
$ npm i -g pnpm

# start examples
$ pnpm dev

# build all packages
$ pnpm build

🐳 Dev Container

To start using development containers, install the Docker extension for VSCode. After installing the extension, open the connection menu either on the bottom left or open it via the commands tab. Select the Open Folder in Container option to mount the project.

The development container will spin up all packages example apps and forward the ports to your machine.

discord logo Discord

Join the Vue Flow Discord server!

Here you can ask questions to the community, propose ideas for new features or share your work that you have built with Vue Flow.

💝 Special Thanks

This project is built with

  • React Flow

    • Vue flow is heavily based on webkids' react flow. I wholeheartedly thank them for their amazing work! Without them Vue Flow would not exist. Please consider donating to them.
  • D3.js

    • D3 makes all the zoom and pan actions in Vue Flow possible.
  • VueUse

    • VueUse is a collection of essential vue composition utilities

⭐ Stargazers

Many thanks to the kind individuals who leave a star. Your support is much appreciated!

Stargazers for @braks/vue-flow

版本与发布记录

@braks/vue-flow 共发布 130 个版本,首次发布于 2021/11/07;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.4.41latest2022/10/084 年前
0.4.402022/09/154 年前
0.4.392022/09/134 年前
0.4.382022/08/314 年前
0.4.372022/08/104 年前
0.4.362022/08/094 年前

其他发布通道:next → 0.4.2-4,0.4.7-0.pr92 → 0.4.7-0.pr92。

关于 @braks/vue-flow 的常见问题

@braks/vue-flow 是什么?

![GitHub code size in bytes](ht注意:该包已被作者标记为弃用——Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

如何安装 @braks/vue-flow?

在项目目录运行 npm install @braks/vue-flow,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.2.25)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@braks/vue-flow 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@braks/vue-flow 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@braks/vue-flow 可以商用吗?

@braks/vue-flow 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@braks/vue-flow 的下载量有多少?

根据 npm 官方下载统计,@braks/vue-flow 在 2026/10/09 – 2026/11/07 这 30 天内被下载 3,574 次,日均约 119 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@braks/vue-flow 还在维护吗?

最新版本 0.4.41 发布于 2022/10/08(4 年前);至今共发布 130 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/11/07。作者已将其标记为弃用,新项目建议寻找替代方案。