File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
packages/theme/components Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -84,18 +84,21 @@ import {
8484 mapMobileObserver ,
8585 unMapMobileObserver ,
8686} from ' @storefront-ui/vue/src/utilities/mobile-observer.js' ;
87- import { defineComponent } from ' @nuxtjs/composition-api' ;
87+ import { computed , defineComponent , onBeforeUnmount } from ' @nuxtjs/composition-api' ;
8888
8989export default defineComponent ({
9090 name: ' InstagramFeed' ,
9191 components: {
9292 SfSection,
9393 },
94- computed: {
95- ... mapMobileObserver (),
96- },
97- beforeDestroy () {
98- unMapMobileObserver ();
94+ setup () {
95+ const isMobile = computed (() => mapMobileObserver ().isMobile .get ());
96+
97+ onBeforeUnmount (() => {
98+ unMapMobileObserver ();
99+ });
100+
101+ return { isMobile };
99102 },
100103});
101104 </script >
You can’t perform that action at this time.
0 commit comments