I have the following code in normal JS and I have like to convert it to vuejs.
HTML:
<div id="ndi"></div>
JS:
const initAuthSessionResponse = window.NDI.initAuthSession(
"ndi",
{
clientId: "abcd1234", // Replace with your client ID
redirectUri: "https://primuslogin.firebaseapp.com/callback/", // Replace with a registered redirect URI
scope: "openid",
responseType: "code"
},
authParamsSupplier,
onError
);
In vuejs this is how I do it but somehow it doesn't work.
<div ref="ndi"></div>
window.NDI.initAuthSession(
this.$refs.ndi,
{
clientId: "abcd1234", // Replace with your client ID
redirectUri: "https://primuslogin.firebaseapp.com/callback/", // Replace with a registered redirect URI
scope: "openid",
responseType: "code"
},
{ state: "abc", nonce: "def" },
this.onError
);
I wonder how I can convert the id in div to vuejs style which usually is done with using ref. Any help would be greately appreciated.
Here is the whole vuejs version: https://gist.github.com/somaria/e965264060502a3c1554953487c7dcff
And this is the normal js version: https://gist.github.com/somaria/e965264060502a3c1554953487c7dcff
The normal js version works well but I have like to convert it to vuejs.