iview/local/routers/tag.vue

77 lines
2 KiB
Vue
Raw Normal View History

2016-09-21 18:44:07 +08:00
<template>
<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>
<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>
</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: {
Tag,
2016-09-22 16:24:20 +08:00
Button,
Progress,
ButtonGroup,
2016-09-22 17:10:01 +08:00
Timeline,
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: {
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-21 18:44:07 +08:00
}
}
</script>