support LoadingBar
support LoadingBar @Jetsly
This commit is contained in:
parent
d978690647
commit
f97e5bb01a
7 changed files with 71 additions and 22 deletions
|
@ -46,3 +46,6 @@ model 改为 value,支持 v-model
|
||||||
### Page
|
### Page
|
||||||
class 改为 className
|
class 改为 className
|
||||||
### DatePicker
|
### DatePicker
|
||||||
|
使用 v-model
|
||||||
|
### LoadingBar
|
||||||
|
部分 prop 移至 data
|
|
@ -55,7 +55,7 @@
|
||||||
- [x] Page
|
- [x] Page
|
||||||
- [x] Breadcrumb
|
- [x] Breadcrumb
|
||||||
- [x] Steps
|
- [x] Steps
|
||||||
- [ ] LoadingBar
|
- [x] LoadingBar
|
||||||
- [x] Circle
|
- [x] Circle
|
||||||
- [x] Affix
|
- [x] Affix
|
||||||
- [x] BackTop
|
- [x] BackTop
|
||||||
|
|
|
@ -50,6 +50,7 @@ li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; }
|
||||||
<li><router-link to="/date">Date</router-link></li>
|
<li><router-link to="/date">Date</router-link></li>
|
||||||
<li><router-link to="/form">Form</router-link></li>
|
<li><router-link to="/form">Form</router-link></li>
|
||||||
<li><router-link to="/table">Table</router-link></li>
|
<li><router-link to="/table">Table</router-link></li>
|
||||||
|
<li><router-link to="/loading-bar">LoadingBar</router-link></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
|
|
|
@ -165,6 +165,10 @@ const router = new VueRouter({
|
||||||
path: '/table',
|
path: '/table',
|
||||||
component: require('./routers/table.vue')
|
component: require('./routers/table.vue')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/loading-bar',
|
||||||
|
component: require('./routers/loading-bar.vue')
|
||||||
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
29
examples/routers/loading-bar.vue
Normal file
29
examples/routers/loading-bar.vue
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<i-button @click.native="start">Start</i-button>
|
||||||
|
<i-button @click.native="finish">Finish</i-button>
|
||||||
|
<i-button @click.native="error">Error</i-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
start () {
|
||||||
|
this.$Loading.start();
|
||||||
|
},
|
||||||
|
finish () {
|
||||||
|
this.$Loading.finish();
|
||||||
|
},
|
||||||
|
error () {
|
||||||
|
this.$Loading.error();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.$Loading.config({
|
||||||
|
color: '#5cb85c',
|
||||||
|
failedColor: '#f0ad4e',
|
||||||
|
height: 5
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,7 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="classes" :style="outerStyles" v-show="show" transition="fade">
|
<transition name="fade">
|
||||||
<div :class="innerClasses" :style="styles"></div>
|
<div :class="classes" :style="outerStyles" v-show="show">
|
||||||
</div>
|
<div :class="innerClasses" :style="styles"></div>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { oneOf } from '../../utils/assist';
|
import { oneOf } from '../../utils/assist';
|
||||||
|
@ -10,10 +12,10 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
percent: {
|
// percent: {
|
||||||
type: Number,
|
// type: Number,
|
||||||
default: 0
|
// default: 0
|
||||||
},
|
// },
|
||||||
color: {
|
color: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'primary'
|
default: 'primary'
|
||||||
|
@ -26,17 +28,27 @@
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 2
|
default: 2
|
||||||
},
|
},
|
||||||
status: {
|
// status: {
|
||||||
type: String,
|
// type: String,
|
||||||
validator (value) {
|
// validator (value) {
|
||||||
return oneOf(value, ['success', 'error']);
|
// return oneOf(value, ['success', 'error']);
|
||||||
},
|
// },
|
||||||
default: 'success'
|
// default: 'success'
|
||||||
},
|
// },
|
||||||
show: {
|
// show: {
|
||||||
type: Boolean,
|
// type: Boolean,
|
||||||
default: false
|
// default: false
|
||||||
}
|
// }
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
percent: 0,
|
||||||
|
// color: 'primary',
|
||||||
|
// failedColor: 'error',
|
||||||
|
// height: 2,
|
||||||
|
status: 'success',
|
||||||
|
show: false
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
classes () {
|
classes () {
|
||||||
|
|
|
@ -19,7 +19,7 @@ import Form from './components/form';
|
||||||
import Icon from './components/icon';
|
import Icon from './components/icon';
|
||||||
import Input from './components/input';
|
import Input from './components/input';
|
||||||
import InputNumber from './components/input-number';
|
import InputNumber from './components/input-number';
|
||||||
// import LoadingBar from './components/loading-bar';
|
import LoadingBar from './components/loading-bar';
|
||||||
import Menu from './components/menu';
|
import Menu from './components/menu';
|
||||||
// import Message from './components/message';
|
// import Message from './components/message';
|
||||||
// import Modal from './components/modal';
|
// import Modal from './components/modal';
|
||||||
|
@ -75,7 +75,7 @@ const iview = {
|
||||||
// iInput: Input,
|
// iInput: Input,
|
||||||
Input,
|
Input,
|
||||||
InputNumber,
|
InputNumber,
|
||||||
// LoadingBar,
|
LoadingBar,
|
||||||
Menu,
|
Menu,
|
||||||
MenuGroup: Menu.Group,
|
MenuGroup: Menu.Group,
|
||||||
MenuItem: Menu.Item,
|
MenuItem: Menu.Item,
|
||||||
|
@ -121,7 +121,7 @@ const install = function (Vue, opts = {}) {
|
||||||
Vue.component(key, iview[key]);
|
Vue.component(key, iview[key]);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Vue.prototype.$Loading = LoadingBar;
|
Vue.prototype.$Loading = LoadingBar;
|
||||||
// Vue.prototype.$Message = Message;
|
// Vue.prototype.$Message = Message;
|
||||||
// Vue.prototype.$Modal = Modal;
|
// Vue.prototype.$Modal = Modal;
|
||||||
// Vue.prototype.$Notice = Notice;
|
// Vue.prototype.$Notice = Notice;
|
||||||
|
|
Loading…
Add table
Reference in a new issue