Ошибка при рендеринге: «Ошибка типа: невозможно прочитать свойство 'fieldName' из неопределенного» - PullRequest
0 голосов
/ 11 мая 2018

Я отображаю пользовательский список компонентов (это только пример), как показано ниже:

<template>
    <ul>
        <li
                v-for="(item, index) in componentList"

                :field-name="MyFieldName"
         >
               <custom_component :index="index" 
                   :some-prop="item.someProps" />
        ></li>
    </ul> 
</template>

<script> 


 export default { 
   name: 'myListComp';

   props: {

     },
     ... other props
  },

  data () {
   return {
        /// ... some other variable/properties for this instance
        myFieldName: '',
       componentList: []
    }
   },

  created () {
        // ...
       Load data from props
       this.myFieldName = this.fieldName;
       // Initialize Component List with the data
       this.componentList = this.initializeComponentList();
         // ...
    },

    methods:{
      initializeComponentList() { 
        // Get the list from AJAX
        return [{}, {}, ....];
      }
    }

} 
</script>

Я получаю странную ошибку, как показано ниже, при отображении списка компонентов.

Вкл.примечание ... Я использую последнюю версию laravel-mix ^ 2.1.11 для компиляции компонентов vue.Я использую Vue ^ 2.5.16 и vuex ^ 3.0.1.enter image description here

...