Skip to content

背景

🌐 Background

Vue Flow 提供两种背景图案:点状和线状。

🌐 Vue Flow comes with two background pattern variants: dots and lines.

安装

🌐 Installation

bash
yarn add @vue-flow/background

# or
npm install @vue-flow/background

用法

🌐 Usage

要使用背景,只需将 Background 组件作为子组件传递给 VueFlow 组件即可。

🌐 To use the background simply pass the Background component as a child to the VueFlow component.

vue
<script setup>
import { VueFlow } from '@vue-flow/core'
import { Background } from '@vue-flow/background'
</script>

<template>
  <VueFlow>
    <Background />
  </VueFlow>
</template>

属性

🌐 Props

名称定义类型可选默认值
variant图案变体BackgroundVariantdots
gap图案间距数字10
size图案大小数字0.4
patternColor图案颜色字符串#81818a
bgColor背景颜色(覆盖图案)字符串#fff
height背景高度数字100
width背景宽度数字100
xX 偏移量数字0
yY 偏移量数字0

VueFlow 中文网 - 粤ICP备13048890号