How to load a custom JS script (in the head) in the "Elements"

Hi there,

I try to get my custom JavaScript library to load and run in the head of the web page.

I have this:

import extern from "./script.js";

export default {
    props: {
        content: { type: Object, required: true },
    },
    setup(props) {
        return { extern };
    },
}

Kind Regards,
Stefan

Hi,

Every page have a custom code property where you can put some code in the head of a page (between <script> my code; </script>) but it will only appear after you published your project.

Hi there,

I need the JavaScript in the compontent (Vue.js), else my other JavaScript function will not work.

Kind Regards,
Stefan

From what I’ve seen with custom library, I think you will need to create a new component… can’t say for sure tho, @weweb-team might have better answer.

Have a look at this topic

Hi there,

Thank you for the resource link about Stripe.

Kind Regards,
Stefan