Merge branch 'master' of gitlab.qima-inc.com:fe/oxygen
This commit is contained in:
@@ -32,15 +32,13 @@
|
||||
* @example
|
||||
* <z-button size="large" type="primary">按钮</z-button>
|
||||
*/
|
||||
|
||||
const allowedSize = ['mini', 'small', 'normal', 'large'];
|
||||
const allowedType = ['default', 'danger', 'primary'];
|
||||
|
||||
export default {
|
||||
name: 'z-button',
|
||||
|
||||
methods: {
|
||||
handleClick(e) {
|
||||
this.$emit('click', e);
|
||||
}
|
||||
},
|
||||
|
||||
props: {
|
||||
disabled: Boolean,
|
||||
loading: Boolean,
|
||||
@@ -49,23 +47,14 @@ export default {
|
||||
type: String,
|
||||
default: 'default',
|
||||
validator(value) {
|
||||
return [
|
||||
'default',
|
||||
'danger',
|
||||
'primary'
|
||||
].indexOf(value) > -1;
|
||||
return allowedSize.indexOf(value) > -1;
|
||||
}
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: 'normal',
|
||||
validator(value) {
|
||||
return [
|
||||
'mini',
|
||||
'small',
|
||||
'normal',
|
||||
'large'
|
||||
].indexOf(value) > -1;
|
||||
return allowedType.indexOf(value) > -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="z-switch" :class="['is-' + switchState]" @click="toggleState">
|
||||
<div class="z-switch-node"></div>
|
||||
<div class="o2-switch" :class="['is-' + switchState]" @click="toggleState">
|
||||
<div class="o2-switch-node" :class="['is-' + switchState]"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* z-switch
|
||||
* o2-switch
|
||||
* @module components/switch
|
||||
* @desc 开关
|
||||
* @param {boolean} [checked=false] - 开关状态
|
||||
@@ -15,10 +15,10 @@
|
||||
* @param {callback} [onChange] - 开关状态改变回调函数。
|
||||
*
|
||||
* @example
|
||||
* <z-switch checked="true" disabled="false"></z-switch>
|
||||
* <o2-switch checked="true" disabled="false"></o2-switch>
|
||||
*/
|
||||
export default {
|
||||
name: 'z-switch',
|
||||
name: 'o2-switch',
|
||||
props: {
|
||||
checked: {
|
||||
type: Boolean,
|
||||
|
||||
@@ -28,16 +28,19 @@
|
||||
@modifier default {
|
||||
color: $button-default-color;
|
||||
background-color: $button-default-background-color;
|
||||
border: 1px solid $button-default-border-color;
|
||||
}
|
||||
|
||||
@modifier primary {
|
||||
color: $button-primary-color;
|
||||
background-color: $button-primary-background-color;
|
||||
border: 1px solid $button-primary-border-color;
|
||||
}
|
||||
|
||||
@modifier danger {
|
||||
color: $button-danger-color;
|
||||
background-color: $button-danger-background-color;
|
||||
border: 1px solid $button-danger-border-color;
|
||||
}
|
||||
|
||||
@modifier large {
|
||||
|
||||
@@ -17,12 +17,15 @@ $c-blue: #38f;
|
||||
$c-background: #f8f8f8;
|
||||
|
||||
/* 按钮颜色 */
|
||||
$button-default-color: $c-white;
|
||||
$button-default-background-color: $c-green-wx;
|
||||
$button-primary-color: $c-black;
|
||||
$button-primary-background-color: $c-white;
|
||||
$button-primary-color: $c-white;
|
||||
$button-primary-background-color: $c-green-wx;
|
||||
$button-primary-border-color: #0a0;
|
||||
$button-default-color: $c-black;
|
||||
$button-default-background-color: $c-white;
|
||||
$button-default-border-color: #bbb;
|
||||
$button-danger-color: $c-white;
|
||||
$button-danger-background-color: #f44;
|
||||
$button-danger-border-color: #e33;
|
||||
|
||||
:root{
|
||||
|
||||
|
||||
@@ -28,11 +28,17 @@
|
||||
@when on {
|
||||
background-color: #44db5e;
|
||||
border-color: #44db5e;
|
||||
@descendent node {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@when off {
|
||||
background-color: #fff;
|
||||
border-color: rgba(0, 0, 0, .1);
|
||||
@descendent node {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@when loading {
|
||||
|
||||
Reference in New Issue
Block a user