By any chance anyone, got this message? Can suggest a workaround? Currently have it in a component and Iâm using ref to insert the content on the div. But getting this error âaddWidget is not a functionâ, also tried to do it without the export default, by putting just the script, but getting the same result. Any advice will be appreciate it :). Here you can see the reference code:
<template>
<div ref="containerSearch"></div>
</template>
<script>
import { ref, onMounted } from 'vue'
import DatoCmsSearch from "../../../public/src/js/base";
import "../../../public/src/js/datocms-search.widget"
var client = new DatoCmsSearch("MY_SECRET_API_KEY", "production");
export default{
setup() {
const containerSearch = ref(null)
onMounted(() => {
if(client){
console.log(client);
client.addWidget(containerSearch);
}
})
return {
containerSearch
}
}
}
</script>```