mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 20:26:16 -08:00
feat: update script tag to setup and use shallowRef for Artplayer instance
This commit is contained in:
1 parent
745d2b4848
commit
ddbcdbd459
2 files changed
+4
-4
No files matched your search
@@ -87,7 +87,7 @@ The player's size depends on the size of the container `container`, so your cont
|
||||
<div ref="$container" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import Artplayer from 'artplayer'
|
||||
import { onBeforeUnmount, onMounted, ref, shallowRef } from 'vue'
|
||||
|
||||
@@ -220,7 +220,7 @@ Importing `Artplayer` will automatically import `artplayer.d.ts`
|
||||
```vue{3}
|
||||
<script setup>
|
||||
import Artplayer from 'artplayer';
|
||||
const art = ref<Artplayer>(null);
|
||||
const art = shallowRef<Artplayer>(null);
|
||||
art.value = new Artplayer();
|
||||
</script>
|
||||
```
|
||||
|
||||
@@ -88,7 +88,7 @@ https://unpkg.com/artplayer/dist/artplayer.js
|
||||
<div ref="$container" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import Artplayer from 'artplayer'
|
||||
import { onBeforeUnmount, onMounted, ref, shallowRef } from 'vue'
|
||||
|
||||
@@ -220,7 +220,7 @@ export default App
|
||||
```vue{3}
|
||||
<script setup>
|
||||
import Artplayer from 'artplayer';
|
||||
const art = ref<Artplayer>(null);
|
||||
const art = shallowRef<Artplayer>(null);
|
||||
art.value = new Artplayer();
|
||||
</script>
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user