Add component's lazy loading
This commit is contained in:
@@ -13,14 +13,13 @@
|
||||
import { mapState } from "vuex";
|
||||
import Footer from "@/components/Footer";
|
||||
import Header from "@/components/Header";
|
||||
import AddFruit from "@/components/AddFruit";
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
components: {
|
||||
Footer,
|
||||
Header,
|
||||
AddFruit
|
||||
AddFruit: () => import("@/components/AddFruit")
|
||||
},
|
||||
computed: {
|
||||
...mapState(["modalIsOpen"])
|
||||
|
||||
@@ -30,12 +30,11 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
import ImageSkeleton from "./ImageSkeleton";
|
||||
|
||||
export default {
|
||||
name: "ImageUnsplash",
|
||||
components: {
|
||||
ImageSkeleton
|
||||
ImageSkeleton: () => import("./ImageSkeleton")
|
||||
},
|
||||
props: {
|
||||
containerClass: {
|
||||
|
||||
@@ -15,13 +15,12 @@
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
import GridItemSkeleton from "./GridItemSkeleton";
|
||||
import GridItem from "./GridItem";
|
||||
|
||||
export default {
|
||||
name: "Grid",
|
||||
components: {
|
||||
GridItemSkeleton,
|
||||
GridItem
|
||||
GridItem: () => import("./GridItem")
|
||||
},
|
||||
props: {
|
||||
data: Array
|
||||
|
||||
@@ -21,11 +21,10 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
import DeleteItem from "./DeleteItem";
|
||||
|
||||
export default {
|
||||
name: "GridItem",
|
||||
components: { DeleteItem },
|
||||
components: { DeleteItem: () => import("./DeleteItem") },
|
||||
props: {
|
||||
item: Object
|
||||
},
|
||||
|
||||
@@ -26,11 +26,10 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
import DeleteItem from "@/components/Grid/DeleteItem";
|
||||
|
||||
export default {
|
||||
name: "FruitDetails",
|
||||
components: { DeleteItem },
|
||||
components: { DeleteItem: () => import("@/components/Grid/DeleteItem") },
|
||||
data() {
|
||||
return {
|
||||
modalOpen: true
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
import Grid from "@/components/Grid/Grid";
|
||||
|
||||
export default {
|
||||
name: "Fruits",
|
||||
components: { Grid },
|
||||
components: { Grid: () => import("@/components/Grid/Grid") },
|
||||
computed: {
|
||||
...mapState(["fruits"])
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user