update docs

This commit is contained in:
Harvey Zack committed 2024-01-10 09:20:13 +08:00
1 parent 434aa3d57d
commit 0dee1ef446
187 files changed
+2011 -1934

No files matched your search

+24 -2
View File
@@ -229,9 +229,31 @@ In `React.js`, directly modifying the `option` will not change the player
## TypeScript
Importing `Artplayer` will automatically import `artplayer.d.ts`, but you can also separately import the type for options
Importing `Artplayer` will automatically import `artplayer.d.ts`
```ts{2}
### Vue.js
```vue{3}
<script setup>
import Artplayer from 'artplayer';
const art = ref<Artplayer>(null);
art.value = new Artplayer();
</script>
```
### React.js
```jsx{2}
import Artplayer from 'artplayer';
const art = useRef<Artplayer>(null);
art.current = new Artplayer();
```
### Option
you can also separately import the type for options
```ts{2,4}
import Artplayer from 'artplayer';
import { type Option } from 'artplayer/types/option';