VueJS: ('element') to Window.getComputedStyle must be an instance of Element
renege opened this issue · 3 comments
Hi,
I have OpenTok working with Vue, so it's different to get the DOM-elements. I found out that "window" was the property to change. So I did.:
var layout = initLayoutContainer(layoutContainer, {
animate: false,
window: document.getElementById("subscribers")
}).layout;
With the HTML:
<div class="flex bg-red-50">
<div id="subscribers"></div>
</div>
But I keep getting:
TypeError: Argument 1 ('element') to Window.getComputedStyle must be an instance of Element
getComputedStyle — opentok-layout.js:524
n — opentok-layout.js:524
(anonieme functie) — opentok-layout.js:640
(anonieme functie)
(anonieme functie) — Session.vue:219
o — opentok.js:45097
+1
You shouldn't be using window
here. window
is for if you want to change what the window element is, eg. you are rendering in a separate window or iframe from where your code is executing.
You layoutContainer should be document.getElementById('subscribers')
I think.