ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.13k stars 14.64k forks source link

Reusing component with multiple data in one Vue instance #17226

Closed momin-riyadh closed 5 years ago

momin-riyadh commented 5 years ago

Similar components for one page but individual data populate

 <el-select v-model="values" placeholder="Select Account">
              <el-option
                      v-for="item in optionss"
                      :key="item.values"
                      :label="item.label"
                      :values="item.values">
              </el-option>
 </el-select>
  <el-select v-model="value" placeholder="Select Account">
              <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value">
              </el-option>
            </el-select>

I populate data correctly

export default class UserWithdraw extends Vue {

        public data() {
            return {
                options: [
                    {
                        value: 'Option1',
                        label: 'Option1',
                    },

                    {
                        value: 'Option2',
                        label: 'Option2',
                    },
                    {
                        value: 'Option3',
                        label: 'Option3',
                    },
                ],
                value: '',
                optionss: [
                    {
                        values: 'bKash',
                        label: 'bKash',
                    },

                    {
                        values: 'Rocket',
                        label: 'Rocket',
                    },
                    {
                        values: 'Bank A/C',
                        label: 'Bank A/C',
                    },
                ],
                values: '',

            };
        }
    }

One component works fine but other components select not work, but data populated correctly, Why?

element-bot commented 5 years ago

Hello, this issue has been closed because it does not conform to our issue requirements. Please submit issues with issue-generator. More info can be found in #3693.