Move isNuxt to helper

This commit is contained in:
Sam Carlton 2022-05-02 22:13:33 -05:00
parent 927791eb73
commit 9a3d255764
2 changed files with 9 additions and 5 deletions

View file

@ -59,11 +59,11 @@
<script> <script>
import has from 'just-has'
import axios from 'axios' import axios from 'axios'
import { v4 as uuid } from 'uuid' import { v4 as uuid } from 'uuid'
import { isNuxt } from '~/helpers/environment.js'
export default { export default {
props: { props: {
// appName: { // appName: {
@ -132,9 +132,7 @@ export default {
// const pagePath = $nuxt.$route.path // const pagePath = $nuxt.$route.path
const isNuxt = has( this, [ '$nuxt' ]) const allUpdateSubscribe = isNuxt( this ) ? this.$config.allUpdateSubscribe : global.$config.allUpdateSubscribe
const allUpdateSubscribe = isNuxt ? this.$config.allUpdateSubscribe : global.$config.allUpdateSubscribe
console.log('allUpdateSubscribe', allUpdateSubscribe) console.log('allUpdateSubscribe', allUpdateSubscribe)

6
helpers/environment.js Normal file
View file

@ -0,0 +1,6 @@
import has from 'just-has'
export function isNuxt( VueThis ) {
return has( VueThis, [ '$nuxt' ])
}