# Usage

## Basic Usage

```vue
<script setup lang="ts">
import { CcpcCadViewer } from '@ccpc/cad-viewer'
</script>

<template>
  <CcpcCadViewer url="https://example.com/demo.dxf" />
</template>
```

## Props

| Prop | Type | Default |
| --- | --- | --- |
| `url` | `string` | `undefined` |
| `localFile` | `File` | `undefined` |
| `locale` | `'default' \| 'en' \| 'zh'` | `'zh'` |
| `background` | `number` | `0x000000` |
| `baseUrl` | `string` | `https://cdn.jsdelivr.net/gh/mlightcad/cad-data/` |
| `theme` | `'light' \| 'dark'` | `'dark'` |
| `mode` | `number` | `AcEdOpenMode.Read` |
| `useMainThreadDraw` | `boolean` | `true` |

## Host Asset Copy

The host app must serve the CAD worker files from `/assets`.

After installing the package, the postinstall script tries to copy those files automatically. If the host layout is custom, copy them manually:

```powershell
npm run copy-assets -- D:\work\modelcollab\public\assets
```
