iview/test/routers/button.vue

114 lines
3.5 KiB
Vue
Raw Normal View History

2016-09-09 14:29:19 +08:00
<template>
2016-10-28 17:24:52 +08:00
<i-button>Default</i-button>
<i-button type="primary">Primary</i-button>
<i-button type="ghost">Ghost</i-button>
2016-09-20 17:10:17 +08:00
<br><br>
2016-10-28 17:24:52 +08:00
<i-button type="primary" size="large">Large</i-button>
<i-button type="primary">Default</i-button>
<i-button type="primary" size="small">Small</i-button>
2016-09-20 17:10:17 +08:00
<br><br>
2016-10-28 17:24:52 +08:00
<i-button>Default</i-button>
<i-button disabled>Default(Disabled)</i-button>
2016-09-20 17:10:17 +08:00
<br><br>
2016-10-28 17:24:52 +08:00
<i-button type="primary">Primary</i-button>
<i-button type="primary" disabled>Primary(Disabled)</i-button>
2016-09-20 17:10:17 +08:00
<br><br>
2016-10-28 17:24:52 +08:00
<i-button type="ghost">Ghost</i-button>
<i-button type="ghost" disabled>Ghost(Disabled)</i-button>
2016-09-20 17:10:17 +08:00
<br><br>
2016-10-28 17:24:52 +08:00
<i-button type="primary" shape="circle" icon="ios-search"></i-button>
<i-button type="primary" icon="ios-search">搜索</i-button>
2016-09-20 17:10:17 +08:00
<br><br>
2016-10-28 17:24:52 +08:00
<i-button type="ghost" shape="circle">
2016-09-20 17:10:17 +08:00
<Icon type="search"></Icon>
2016-10-28 17:24:52 +08:00
</i-button>
<i-button type="ghost">
2016-09-20 17:10:17 +08:00
<Icon type="search"></Icon>
搜索
2016-10-28 17:24:52 +08:00
</i-button>
<i-button type="ghost" shape="circle" size="large">
2016-09-20 17:10:17 +08:00
<Icon type="search"></Icon>
2016-10-28 17:24:52 +08:00
</i-button>
<i-button type="ghost" shape="circle" size="small">
2016-09-20 17:10:17 +08:00
<Icon type="search"></Icon>
2016-10-28 17:24:52 +08:00
</i-button>
2016-09-20 17:10:17 +08:00
<br><br><br>
2016-10-28 17:24:52 +08:00
<i-button type="primary" loading>Loading...</i-button>
<i-button type="primary" loading size="large">Loading...</i-button>
<i-button type="primary" loading size="small">Loading...</i-button>
<i-button type="primary" :loading="loading" @click="toLoading">
2016-09-20 17:10:17 +08:00
<span v-if="!loading">Click me!</span>
<span v-else>Loading...</span>
2016-10-28 17:24:52 +08:00
</i-button>
<i-button type="primary" :loading="loading2" icon="checkmark-round" @click="toLoading2">
2016-09-20 17:10:17 +08:00
<span v-if="!loading2">Click me!</span>
<span v-else>Loading...</span>
2016-10-28 17:24:52 +08:00
</i-button>
2016-09-20 17:10:17 +08:00
<h4>基本</h4>
<Button-group size="large">
2016-10-28 17:24:52 +08:00
<i-button>取消</i-button>
<i-button type="primary">确定</i-button>
2016-09-20 17:10:17 +08:00
</Button-group>
2016-09-09 14:29:19 +08:00
<Button-group>
2016-10-28 17:24:52 +08:00
<i-button type="primary">L</i-button>
<i-button>M</i-button>
<i-button type="ghost">R</i-button>
2016-09-20 17:10:17 +08:00
</Button-group>
<h4>配合图标</h4>
<Button-group>
2016-10-28 17:24:52 +08:00
<i-button type="primary">
2016-09-20 17:10:17 +08:00
<Icon type="chevron-left"></Icon>
前进
2016-10-28 17:24:52 +08:00
</i-button>
<i-button type="primary">
2016-09-20 17:10:17 +08:00
后退
<Icon type="chevron-right"></Icon>
2016-10-28 17:24:52 +08:00
</i-button>
2016-09-20 17:10:17 +08:00
</Button-group>
<Button-group>
2016-10-28 17:24:52 +08:00
<i-button type="primary" icon="cloud"></i-button>
<i-button type="primary" icon="upload"></i-button>
2016-09-09 14:29:19 +08:00
</Button-group>
</template>
<script>
import { Button, Icon, Input, Switch, Radio, Checkbox, InputNumber, Row, Col, Page } from 'iview';
const ButtonGroup = Button.Group;
const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group;
export default {
components: {
2016-10-28 17:24:52 +08:00
iButton: Button,
2016-09-09 14:29:19 +08:00
ButtonGroup,
Icon,
iInput: Input,
Switch,
Radio,
RadioGroup,
Checkbox,
CheckboxGroup,
InputNumber,
Row,
iCol: Col,
Page
},
props: {
2016-10-28 17:24:52 +08:00
2016-09-09 14:29:19 +08:00
},
data () {
return {
2016-09-20 17:10:17 +08:00
loading: false,
loading2: false
2016-10-28 17:24:52 +08:00
}
2016-09-09 14:29:19 +08:00
},
methods: {
2016-09-20 17:10:17 +08:00
toLoading () {
this.loading = true;
2016-09-09 14:29:19 +08:00
},
2016-09-20 17:10:17 +08:00
toLoading2 () {
this.loading2 = true;
2016-09-09 14:29:19 +08:00
}
}
}
</script>