Answer the question
In order to leave comments, you need to log in
How to dynamically import a vue.js module?
Hello.
I need to get the name of the module from props.
I did this and it works:
<template>
<div>
<component :is="componentLoader" :parent="response.parent"></component>
</div>
</template>
<script>
export default {
props: ["response"],
computed: {
componentLoader() {
this.response; //Если я вызову response тут...
return () => {
this.parent = this.response.tempParam; // то здесь я смогу получить доступ к tempParam, в противном случае получается undefined
return import("./response/" + this.parent);
};
}
}
};
</script>>
<style scoped>
</style>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question