2017-10-08 14 views
0

문제가 있습니다. nuxt.js의 미디어 쿼리에서 vue.fullpage 플러그인을 비활성화하는 방법은 무엇입니까? nuxt.config.jsnuxt.js의 미디어 쿼리에서 vue.fullpage 플러그인을 비활성화하는 방법은 무엇입니까?

module.exports = { 
    plugins: { 
    '~plugins/fullpage-vue.js' 
    } 
} 

fullpage-vue.js

import Vue from 'vue' 
import 'animate.css' 
import 'fullpage-vue/src/fullpage.css' 
import VueFullpage from 'fullpage-vue' 

if (screen && screen.width > 768) { 
    Vue.use(VueFullpage) 
} 

그래서 작동하지 않습니다. 오류 : 화면이 정의되지 않았습니다.

+0

에 발표 된 official vullpage를 사용한다 .js 구성 요소 (Vue.js)] (https://alvarotrigo.com/vue-fullpage/)를 사용하면 반응 형 옵션을 사용할 수 있습니다. – Alvaro

답변

0

도움이되었습니다. 당신이 SSR을 필요로하는 경우

if (screen.width > 768) { 
    Vue.use(VueFullpage) 
    console.log('fullPage init') 
} 

또는 어쩌면

if (process.browser) { 
    if (screen.width > 768) { 
     Vue.use(VueFullpage) 
     console.log('fullPage init') 
    } 
} 

를 사용하지만 [공식 fullPage을 활용하면 더 나은 아이디어가 정말 1월 2018