Closed Eric-Bryan closed 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
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
`
export default { name: 'App', components: { }, head: { title: { inner: 'It will be a pleasure 123' }, link: [ { rel:'stylesheet', href:'./style.css' } ] } }
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.
2nd Question : Is there a way to set href of link with a data ? Thanks a lot in advance.
@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
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
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
`
export default { name: 'App', components: { }, head: { title: { inner: 'It will be a pleasure 123' }, link: [
{ rel:'stylesheet', href:'./style.css' } ] } }
`
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.
2nd Question : Is there a way to set href of link with a data ? Thanks a lot in advance.
@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