ktquez / vue-head

Manager the meta information of the head tag, a simple and easy way
MIT License
984 stars 73 forks source link

head\link\stylesheet doesn't work #70

Closed Eric-Bryan closed 6 years ago

Eric-Bryan commented 6 years ago

Hello,

I would like to set dynamically the css file of my vue.

I have reached to set the title using vue-head. I set a css file into a link tag using vue-head but the css class don't work in my page (the

is not set to red).

Here is my App.vue :

(sorry I haven't reached to insert my code correctly)

template div id="app" div class="titleRed">Example at 14h35 /div /div /template

``

I checked that the css file (style.css) is in the same folder than App.vue and that the class "titleRed" is set in the style.css file.

In Google dev tools I have the : link rel="stylesheet" href="./style.css"

What have I missed ?

Thanks a lot in advance.

Eric.

Eric-Bryan commented 6 years ago

2nd Question : Is there a way to set href of link with a data ? Thanks a lot in advance.

ktquez commented 6 years ago

@Eric-Bryan First question In this case you can use require ('my-css-path')

Second question If I understand correctly, you can find how to do it here. https://github.com/ktquez/vue-head#using-this