Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Loading Plaid JS from CDN in VueJS

I'm trying to get Plaid working in VueJS but I just can't get the JS loading.

This works fine using Vanilla JS: https://jsfiddle.net/5vnh2ubs/

But this just doesn't seem to work:

<template>
  <div id="app">
    {{ pl }}
  </div>
</template>

<script>
export default {
  beforeMount() {
    this.pl = this.Plaid;
  },
  data() {
    return {
      pl: null,
    };
  },
};
</script>

I've tried importing the script in the index.html file and used vue-plugin-load-script but nothing seems to work.

I've never had this issue when loading JS files in the index.html file.

Edit:

This is how I've tried loading it using vue-plugin-load-script:

this.$loadScript('https://cdn.plaid.com/link/v2/stable/link-initialize.js')
.then(() => {
    console.log(this.Plaid);
})
.catch(() => {
    console.log('error');
});

And in index.html, it's a simple script tag between the head tags:

<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>

I can see the script tag is there when I inspect elements but calling Plaid returns nothing.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The Plaid CDN script creates a global variable: window.Plaid. However, your component incorrectly refers to it via this.Plaid. In the Vue SFC, this is the component instance, which only contains its own properties declared in the component definition. this does not include global variables from window.

The solution is to use window.Plaid:

export default {
  data() {
    return {
      pl: window.Plaid,
    }
  }
}

demo

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!