Switch add large size and optimize style

Switch add large size and optimize style
This commit is contained in:
梁灏 2016-11-02 12:07:52 +08:00
parent 77b4e431e0
commit 2af5843d96
7 changed files with 81 additions and 22 deletions

View file

@ -35,6 +35,7 @@ li + li {
<li><a v-link="'/select'">Select</a></li>
<li><a v-link="'/slider'">Slider</a></li>
<li><a v-link="'/step'">Step</a></li>
<li><a v-link="'/switch'">Switch</a></li>
</ul>
</nav>
<router-view></router-view>

View file

@ -65,6 +65,11 @@ router.map({
component: function (resolve) {
require(['./routers/step.vue'], resolve);
}
},
'/switch': {
component: function (resolve) {
require(['./routers/switch.vue'], resolve);
}
}
});

34
test/routers/switch.vue Normal file
View file

@ -0,0 +1,34 @@
<template>
<Switch @on-change="change"></Switch>
<Switch>
<span slot="open"></span>
<span slot="close"></span>
</Switch>
<Switch size="large">
<span slot="open">ON</span>
<span slot="close">OFF</span>
</Switch>
<Switch>
<Icon type="android-done" slot="open"></Icon>
<Icon type="android-close" slot="close"></Icon>
</Switch>
<Switch :disabled="disabled"></Switch>
<i-button type="primary" @click="disabled = !disabled">Toggle Disabled</i-button>
<Switch size="small"></Switch>
</template>
<script>
import { Switch, Message, iButton, Icon } from 'iview';
export default {
components: { Switch, Message, iButton, Icon },
data () {
return {
disabled: true
}
},
methods: {
change (status) {
Message.info('开关状态:' + status);
}
}
}
</script>