requireを使用してコンポーネントを動的に導入しても機能しないか、コンポーネントが見つからないという問題があります.
383 ワード
this.data.attributeOptions.controlTypeOptions.forEach(item => {
let newPath = '' + item.path + '/' + item.controlType + '/index.vue'
let path = newPath.replace(/\/\//g,"/")
item.component = require(''+path).default
})
**
ここで注意したいのは、require(’’+path)変数の前に必ず空の文字列を付けることです.
**