Element: [Bug Report] el-radio loop error

Created on 9 Nov 2017  ·  2Comments  ·  Source: ElemeFE/element

Element UI version

2.0.3

OS/Browsers version

Win10/Chrome 62.0.3202.75

Vue version

2.5.3

Reproduction Link

https://codepen.io/bin20060407/pen/dZNYdq?editors=1111

Steps to reproduce

loop el-radio,when default is empty

<template>
    <div>
        <el-radio-group>
            <el-radio-button v-for="attr in attrOptions" :key="attr.id" :label="attr.id">{{attr.name}}
            </el-radio-button>
        </el-radio-group>
    </div>
</template>
<script>
export default {
    name: 'test',
    data() {
        return {
            attrOptions: []
        };
    },
    created() {
        this.getApiData();
    },
    methods: {
        // ajax get
        getApiData() {
            let me = this;
            setTimeout(function() {
                me.attrOptions = [
                    {
                        id: 1,
                        name: '北京'
                    },
                    {
                        id: 2,
                        name: '上海'
                    },
                    {
                        id: 3,
                        name: '广州'
                    },
                    {
                        id: 4,
                        name: '武汉'
                    }
                ];
            }, 500);
        }
    }
};
</script>

What is Expected?

radio show

What is actually happening?

radio shows, but the console error:
found in

--->

Most helpful comment

All 2 comments

Translation of this issue:

Element UI version

2.0.3

OS/Browsers version

Win10/Chrome 62.0.3202.75

Vue version

2.5.3

Reproduction Link

https://raw.githubusercontent.com/bin20060407/clutter/master/el-radio.js

Steps to reproduce

Loop el-radio, when default is empty

.

.

What is Expected?

Radio show

What is actually happening?

Radio shows, but the console error:
Found in
I

Was this page helpful?
0 / 5 - 0 ratings