0
  1. I'm trying to embed a map to my vue component which is written in java script.
  2. I downloaded that map from this web link. Sri Lanka Map

  3. In that map files documentation enter image description here

They say to include some JS and CSS files to the head section.

Eg :- <link href="jsmaps/jsmaps.css" rel="stylesheet" type="text/css" />

Where is the head section in my template and how do I inject JS / CSS files to that head section?

4
  • head section is in the index.html file Commented Mar 22, 2018 at 3:28
  • Are you using vue-cli? Commented Mar 22, 2018 at 3:30
  • Yes I'm using vue cli Commented Mar 22, 2018 at 3:32
  • @Bhojendra Nepal I don't want to load it for the all of the users. I only want to load it to the certain users. Commented Mar 22, 2018 at 3:34

1 Answer 1

1

There are several ways to manipulate the head section of single page application. Currently you can use Vue plugin named Vue Meta, take a look this repository https://github.com/declandewet/vue-meta.

But if you don't wanna make your hands dirty with that, you can use Nuxt.js, take a look this link https://nuxtjs.org/. Nuxt.js provides an easy way to create a project with Vue.js. You just edit the nuxt.config.js file like described here https://nuxtjs.org/api/configuration-head

Even you also can configure head section of specific page as you mention on the comment above.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.