Skip to content

AI-native design editor. Open-source Figma alternative.

917 B
Raw Blame

title: useExport description: Manage export settings like scale and format for the current selection.

useExport

useExport() is the export-panel composable for selected nodes.

It manages:

  • export settings rows
  • selected node ids
  • export name labeling
  • supported scales and formats (formats ids and labeled formatOptions)

Usage

import { useExport } from '@open-pencil/vue/document/export'

const exportState = useExport()

Basic example

const {
  settings,
  nodeName,
  scales,
  formats,
  formatOptions,
  addSetting,
  updateScale,
  updateFormat,
} = useExport()

Practical examples

Add another export preset

exportState.addSetting()

Change the first export to 2x WEBP

exportState.updateScale(0, 2)
exportState.updateFormat(0, 'webp')

Related APIs