Skip to content

Commit

Permalink
fix: Radio.vue and RadioButton.vue get elForm disabled attribute error
Browse files Browse the repository at this point in the history
Detailed description see: #317
  • Loading branch information
qiqingfu committed Nov 6, 2020
1 parent e778c71 commit ae29201
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions packages/radio-button/RadioButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default {
}
function useInject() {
const elForm = inject('elFrom', {})
const elForm = inject('elForm', {})
const elFormItem = inject('elFormItem', {})
return {
elForm,
Expand Down Expand Up @@ -139,11 +139,10 @@ function useModel({ radioGroup }) {
function useStyle({ radioGroup, disabled, value, label, elForm, elFormItem }) {
const { ctx } = getCurrentInstance()
const elFormDisable = (elForm.props || {}).disabled
const elFormItemSize = (elFormItem.ctx || {}).elFormItemSize
const elFormDisable = elForm.disabled
const size = computed(() => {
const temRadioSize = elFormItemSize || (ctx.$ELEMENT || {}).size
const temRadioSize = elFormItem.elFormItemSize || (ctx.$ELEMENT || {}).size
return radioGroup.ctx.radioGroupSize || temRadioSize
})
const isDisabled = computed(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/radio/Radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default {
}
function useInject() {
const elForm = inject('elFrom', {})
const elForm = inject('elForm', {})
const elFormItem = inject('elFormItem', {})
return {
elForm,
Expand Down Expand Up @@ -173,7 +173,7 @@ function useStyle({
elFormItem
}) {
const { ctx } = getCurrentInstance()
const elFormDisable = (elForm.props || {}).disabled
const elFormDisable = elForm.disabled
const radioSize = computed(() => {
const temRadioSize =
unref(size) || elFormItem.elFormItemSize || (ctx.$ELEMENT || {}).size
Expand Down

0 comments on commit ae29201

Please sign in to comment.