2016-09-21 18:44:07 +08:00
|
|
|
<template>
|
2016-09-22 13:42:59 +08:00
|
|
|
<div>
|
|
|
|
<Button @click="start">start</Button>
|
|
|
|
<Button @click="destroy">destroy</Button>
|
|
|
|
<Button @click="finish">finish</Button>
|
|
|
|
<Button @click="error">error</Button>
|
|
|
|
<Button @click="update">update</Button>
|
2016-09-22 16:24:20 +08:00
|
|
|
<br><br>
|
2016-09-22 17:10:01 +08:00
|
|
|
<Timeline>
|
|
|
|
<Timeline-item>
|
2016-09-22 18:28:19 +08:00
|
|
|
<Icon type="close-circled" slot="dot"></Icon>
|
2016-09-22 17:10:01 +08:00
|
|
|
<p class="time">1976年</p>
|
|
|
|
<p class="content">Apple I 问世</p>
|
|
|
|
</Timeline-item>
|
|
|
|
<Timeline-item>
|
|
|
|
<p class="time">1984年</p>
|
|
|
|
<p class="content">发布 Macintosh</p>
|
|
|
|
</Timeline-item>
|
|
|
|
</Timeline>
|
2016-09-22 13:42:59 +08:00
|
|
|
</div>
|
2016-09-21 18:44:07 +08:00
|
|
|
</template>
|
|
|
|
<script>
|
2016-09-22 17:10:01 +08:00
|
|
|
import { Tag, LoadingBar, Button, Progress, Icon, Timeline } from 'iview';
|
2016-09-22 16:24:20 +08:00
|
|
|
const ButtonGroup = Button.Group;
|
2016-09-22 17:10:01 +08:00
|
|
|
const TimelineItem = Timeline.Item;
|
2016-09-21 18:44:07 +08:00
|
|
|
export default {
|
|
|
|
components: {
|
2016-09-22 13:42:59 +08:00
|
|
|
Tag,
|
2016-09-22 16:24:20 +08:00
|
|
|
Button,
|
|
|
|
Progress,
|
|
|
|
ButtonGroup,
|
2016-09-22 17:10:01 +08:00
|
|
|
Timeline,
|
2016-09-22 18:28:19 +08:00
|
|
|
TimelineItem,
|
|
|
|
Icon
|
2016-09-21 18:44:07 +08:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
2016-09-22 16:24:20 +08:00
|
|
|
percent: 0
|
2016-09-21 18:44:07 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
2016-09-22 13:42:59 +08:00
|
|
|
start () {
|
|
|
|
LoadingBar.start();
|
|
|
|
},
|
|
|
|
destroy () {
|
|
|
|
LoadingBar.destroy();
|
|
|
|
},
|
|
|
|
finish () {
|
|
|
|
LoadingBar.finish();
|
|
|
|
},
|
|
|
|
error () {
|
|
|
|
LoadingBar.error();
|
|
|
|
},
|
|
|
|
update () {
|
|
|
|
LoadingBar.update(50);
|
2016-09-22 16:24:20 +08:00
|
|
|
},
|
|
|
|
add () {
|
|
|
|
if (this.percent >= 100) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
this.percent += 10;
|
|
|
|
},
|
|
|
|
minus () {
|
|
|
|
if (this.percent <= 0) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
this.percent -= 10;
|
2016-09-22 13:42:59 +08:00
|
|
|
}
|
2016-09-21 18:44:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|