Switch add large size and optimize style
Switch add large size and optimize style
This commit is contained in:
parent
77b4e431e0
commit
2af5843d96
7 changed files with 81 additions and 22 deletions
|
@ -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>
|
||||
|
|
|
@ -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
34
test/routers/switch.vue
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue