Skip to content

Commit

Permalink
fix!: ScriptCarbonAds prefer ready event
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jul 6, 2024
1 parent 21c7e89 commit d32e0d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/components/ScriptCarbonAds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const props = defineProps<{
const emit = defineEmits<{
error: [error: string | Event]
load: []
ready: [HTMLScriptElement]
}>()
const attrId = `_carbonads_js`
Expand All @@ -40,7 +40,7 @@ function loadCarbon() {
}
script.onload = () => {
status.value = 'loaded'
emit('load')
emit('ready', script)
}
carbonadsEl.value.appendChild(script)
}
Expand Down

0 comments on commit d32e0d8

Please sign in to comment.