Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <component :is="test" :config="componentList[0]"></component><br>
- export default {
- async fetch({ store, $axios }) {
- await store.dispatch("getPageBySlug", "home");
- },
- computed: {
- test() {
- return () => import('~/components/HeroIntro');
- }
- }
- };
- <component
- v-for="component in componentList"
- :key="component.acf_fc_layout"
- :is="component.acf_fc_layout"
- :config="component">
- </component>
- export default {
- async fetch({ store, $axios }) {
- await store.dispatch("getPageBySlug", "home");
- },
- computed: {
- page() {
- return this.$store.getters.getPageBySlug("home");
- },
- componentList() {
- return this.page.acf.flexible_content;
- },
- componentsToImport() {
- for(const component of this.componentList) {
- () => import('~/components' + component.acf_fc_layout);
- }
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement