Skip to content

How to call main.js functions in modern theme? #9414

Answered by glopesdev
glopesdev asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, finally understand that main.js simply runs already in the right place to manipulate DOM elements, so if you have a function you need to call, the following seems to work well:

async function my_init() {
}

export default { }
my_init();

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@glopesdev
Comment options

@glopesdev
Comment options

Answer selected by glopesdev
@yufeih
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants