mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 19:41:25 -08:00
update docs
This commit is contained in:
1 parent
434aa3d57d
commit
0dee1ef446
187 files changed
+2011
-1934
No files matched your search
@@ -232,9 +232,31 @@ export default App;
|
||||
|
||||
## TypeScript
|
||||
|
||||
导入 `Artplayer` 时会自动导入的 `artplayer.d.ts`,但你也可以单独导入选项的类型
|
||||
导入 `Artplayer` 时会自动导入的 `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
|
||||
|
||||
你也可以单独导入选项的类型
|
||||
|
||||
```ts{2,4}
|
||||
import Artplayer from 'artplayer';
|
||||
import { type Option } from 'artplayer/types/option';
|
||||
|
||||
|
||||
Reference in new issue
Block a user