Reputation: 141
I need to add some data attributes for body tag. How can i do that?
<body data-spy="scroll" data-target=".navbar-nav" data-offset="110">
Upvotes: 1
Views: 3972
Reputation: 1205
You can achieve that by putting your attributes in the head
object of your component declaration :
<script>
export default {
head: {
bodyAttrs: {
'data-spy': 'scroll',
'data-target': '.navbar-nav',
'data-offset': '110'
}
}
// ...
}
</script>
Upvotes: 10