SHARE
TWEET

Untitled

a guest Jun 26th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <component :is="test" :config="componentList[0]"></component><br>
  2.  
  3. export default {
  4.   async fetch({ store, $axios }) {
  5.     await store.dispatch("getPageBySlug", "home");
  6.   },
  7.  
  8.   computed: {
  9.     test() {
  10.       return () => import('~/components/HeroIntro');
  11.     }
  12.   }
  13. };
  14.      
  15. <component
  16.       v-for="component in componentList"
  17.       :key="component.acf_fc_layout"
  18.       :is="component.acf_fc_layout"
  19.       :config="component">
  20. </component>
  21.      
  22. export default {
  23.   async fetch({ store, $axios }) {
  24.     await store.dispatch("getPageBySlug", "home");
  25.   },
  26.  
  27.   computed: {
  28.     page() {
  29.       return this.$store.getters.getPageBySlug("home");
  30.     },
  31.     componentList() {
  32.       return this.page.acf.flexible_content;
  33.     },
  34.     componentsToImport() {
  35.       for(const component of this.componentList) {
  36.         () => import('~/components' + component.acf_fc_layout);
  37.       }
  38.     }
  39.   }
  40. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top