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';
+24 -2
View File
@@ -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';
+3 -3
View File
@@ -9,8 +9,8 @@
"devDependencies": {
"flexsearch": "^0.7.31",
"markdown-it": "^13.0.2",
"vitepress": "^1.0.0-rc.31",
"vitepress-plugin-search": "^1.0.4-alpha.20",
"vue": "^3.3.9"
"vitepress": "^1.0.0-rc.36",
"vitepress-plugin-search": "^1.0.4-alpha.22",
"vue": "^3.4.7"
}
}