码迷,mamicode.com
首页 > 其他好文 > 详细

vuerouter-11_常用组件库

时间:2019-08-25 00:30:23      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:ESS   option   create   ted   install   gre   github   col   ansi   

vue常用的组件库网址:https://github.com/vuejs/awesome-vue

1.v-tooltip的安装

npm install --save v-tooltip
2.全局引入:
import VTooltip from ‘v-tooltipVue.use(VTooltip)
3.实例:

<template>
<div class="mine">Mine
<button v-tooltip="‘You have ‘ + count + ‘ new messages.‘">按钮</button>
<br>
<br>
<button v-tooltip.bottom="‘You have 200 new messages.‘">按钮11</button>
<Nav />
</div>
</template>

<script>
import Nav from ‘../nav‘
export default {
name: ‘Mine‘,
components: {
Nav
},
data() {
return {
count:100
}
}
}
</script>

<style lang="css" scoped>
</style>

--------------------------------------------------------------------------------------------------------------

1.安装

npm install vue-progressbar --save
2.全局引入:
import Vue from ‘vueimport VueProgressBar from ‘vue-progressbarimport App from ‘./Appconst options = {
  color: ‘#bffaf3‘,
  failedColor: ‘#874b4b‘,
  thickness: ‘5px‘,
  transition: {
    speed: ‘0.2s‘,
    opacity: ‘0.6s‘,
    termination: 300
  },
  autoRevert: true,
  location: ‘left‘,
  inverse: false
}

Vue.use(VueProgressBar, options)
3.实例:

<template>
<div class="order">
order
<vue-progress-bar></vue-progress-bar>
<Nav />
</div>
</template>

<script>
import Nav from ‘../Nav‘
export default{
name:"Order",
components:{
Nav
},
data(){
return{

}
},
mounted () {
// [App.vue specific] When App.vue is finish loading finish the progress bar
this.$Progress.finish()
},
created () {
// [App.vue specific] When App.vue is first loaded start the progress bar
this.$Progress.start()
// hook the progress bar to start before we move router-view
this.$router.beforeEach((to, from, next) => {
// does the page we want to go to have a meta.progress object
if (to.meta.progress !== undefined) {
let meta = to.meta.progress
// parse meta tags
this.$Progress.parseMeta(meta)
}
// start the progress bar
this.$Progress.start()
// continue to next page
next()
})
// hook the progress bar to finish after we‘ve finished moving router-view
this.$router.afterEach((to, from) => {
// finish the progress bar
this.$Progress.finish()
})
}
}
</script>

<style lang="css" scoped>
</style>

 



vuerouter-11_常用组件库

标签:ESS   option   create   ted   install   gre   github   col   ansi   

原文地址:https://www.cnblogs.com/xiao-peng-ji/p/11406602.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!