Ready to add extra components for VueJS.
npm install --save vue-extra
- Currently the module supports vue-extra/Navbar only. However I will be adding some more elements in future.
...
<Navbar :navbar="navbar" :style={fontFamily:'arial'}></Navbar>
...
:style attribute is optional that lets you change the style of outer navbar element. variable "navbar" is defined below in javascript code
Full Example :
import Navbar from 'vue-extra/Navbar'
export default {
data () {
return {
navbar:{
defaultAlign:'right', // Default alignment of items in navbar
backgroundColor:'#222', // background color of navbar
color:'#ddd', // color of items in navbar
activeLinkColor:'#f90', // color of .active class link in navbar
hoverColor:'#ff0', // color when hovered over item
brand:'Vue<span style="color:#ccc">Extra</span>',
shadow:true, // shadow effect on navbar
navItems:[
{
name:'Home',
href:"home",
class:'active',
},
{
name:'News',
href:"https://github.com/saurabhdaware",
router:false, // By default all navItems are rendered as <router-link> by setting router:false we tell code to render element as <a> instead.
},
{
name:'Contact',
href:"home",
},
{
name:'Login',
href:'#login',
align:'right',
style:{fontWeight:'bold'}
}
]
}
}
},
components:{
Navbar
}
}
navbar:{
backgroundColor:'#222',
color:'#ddd',
hoverColor:'#fff',
activeLinkColor:'#09f'
}
navbar:{
brand:'CompanyName'
}
or
navbar:{
brand:'https://image.com/logo.png' // Link of image - This will be rendered as an image
}
navbar:{
shadow:true // false
}
navbar:{
defaultAlign:'right' // 'left'
}
To change the property that is once set, sadly you have to change the whole navbar object. You can do this like this.navbar = {...this.navbar,color:'#f30'}
. Here's example to change color of links after 2 seconds.
mounted(){
setTimout(()=>{
this.navbar = {...this.navbar,color:'#f30'}
},2000)
}
Ummm I am still working on this.
- This project is open for contributions you can pick up a task from Issues or Work on a new feature.
- Read CONTRIBUTING.md before contributing for complete guide of Contribution and Local Development.