From 9df74bedd7640b6066010c498f942ce544c658b7 Mon Sep 17 00:00:00 2001 From: tjz <415800467@qq.com> Date: Sun, 17 Jun 2018 17:46:09 +0800 Subject: [PATCH] fix: update disabled radiogroup's classname --- components/radio/Radio.jsx | 33 ++++++++----------- .../__tests__/__snapshots__/demo.test.js.snap | 18 +++++----- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/components/radio/Radio.jsx b/components/radio/Radio.jsx index 154fc2ea5..c83749b55 100644 --- a/components/radio/Radio.jsx +++ b/components/radio/Radio.jsx @@ -41,24 +41,6 @@ export default { } }) }, - computed: { - classes () { - const { prefixCls, disabled, stateChecked } = this - return { - [`${prefixCls}-wrapper`]: true, - [`${prefixCls}-wrapper-checked`]: stateChecked, - [`${prefixCls}-wrapper-disabled`]: disabled, - } - }, - checkboxClass () { - const { prefixCls, disabled, stateChecked } = this - return { - [`${prefixCls}`]: true, - [`${prefixCls}-checked`]: stateChecked, - [`${prefixCls}-disabled`]: disabled, - } - }, - }, methods: { handleChange (event) { const targetChecked = event.target.checked @@ -114,7 +96,7 @@ export default { }, }, render () { - const { id, classes, checkboxClass, prefixCls, + const { id, prefixCls, stateChecked, handleChange, $slots, onFocus, onBlur, @@ -127,9 +109,20 @@ export default { name = radioGroupContext.name disabled = disabled || radioGroupContext.disabled } + const wrapperClassString = { + [`${prefixCls}-wrapper`]: true, + [`${prefixCls}-wrapper-checked`]: stateChecked, + [`${prefixCls}-wrapper-disabled`]: disabled, + } + const checkboxClass = { + [`${prefixCls}`]: true, + [`${prefixCls}-checked`]: stateChecked, + [`${prefixCls}-disabled`]: disabled, + } + return (