[improvement] Functional components be just functions (#2735)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { use } from '../utils';
|
||||
import Loading from '../loading';
|
||||
import SwitchMixin from '../mixins/switch';
|
||||
import { switchProps } from './shared';
|
||||
|
||||
const [sfc, bem] = use('switch');
|
||||
|
||||
export default sfc({
|
||||
mixins: [SwitchMixin],
|
||||
props: switchProps,
|
||||
|
||||
methods: {
|
||||
onClick() {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Common Switch Props
|
||||
*/
|
||||
|
||||
export const switchProps = {
|
||||
value: null,
|
||||
loading: Boolean,
|
||||
disabled: Boolean,
|
||||
activeColor: String,
|
||||
inactiveColor: String,
|
||||
activeValue: {
|
||||
type: null,
|
||||
default: true
|
||||
},
|
||||
inactiveValue: {
|
||||
type: null,
|
||||
default: false
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: '30px'
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user