vanilla-vue-ui 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="hidden"></span>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { onMounted } from 'vue'
|
|
7
|
+
|
|
8
|
+
const SCRIPT_SRC = 'https://platform.twitter.com/widgets.js'
|
|
9
|
+
|
|
10
|
+
onMounted(() => {
|
|
11
|
+
// すでに読み込まれていたら二重読み込みしない
|
|
12
|
+
const exists = document.querySelector<HTMLScriptElement>(
|
|
13
|
+
`script[src="${SCRIPT_SRC}"]`,
|
|
14
|
+
)
|
|
15
|
+
if (exists) return
|
|
16
|
+
|
|
17
|
+
const script = document.createElement('script')
|
|
18
|
+
script.src = SCRIPT_SRC
|
|
19
|
+
script.async = true
|
|
20
|
+
script.charset = 'utf-8'
|
|
21
|
+
|
|
22
|
+
document.head.appendChild(script)
|
|
23
|
+
})
|
|
24
|
+
</script>
|