What is the best way to create an external library object in nuxt?

Asked 6 days ago, Updated 6 days ago, 1 views

We are developing nuxt.

I create an object in mounted() in page/about.vue to use an external library.

The user is now

This object is in mounted()<:/p>

It is written as
new library.widget({}).

On the other hand, if the page movement is not a nuxt-link, but a tag, the problem is eliminated.

Is the initialization position wrong? Should I use the tag a on the nuxt app? I ask for your help me.

javascript

2022-09-20 15:06

1 Answers

I don't know much about Vue or Nuxt, but the feeling is that you need to check how to redirect after logging in to . In short, Did you even log in?" is what it is. With a significant probability, at the end of Step 4, the login may not actually be successful.

Login is the process of obtaining credentials, and the situation you mentioned seems to be necessary to doubt whether the server failed to give credentials in the first place or whether the client lost the credentials that the server gave. It's especially because of the message that it worked well when I moved to a tag, because if the server is giving the authentication information as a cookie, it's hard to get the cookie as AJAX and write it on the device.

Would you like to check that out? mounted() is the next story.


2022-09-20 15:06

If you have any answers or tips


© 2022 pinfo. All rights reserved.