Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Request to Restore DEV vs PROD Documentation Page #435

Open
altShiftDev opened this issue Mar 21, 2018 · 0 comments
Open

Request to Restore DEV vs PROD Documentation Page #435

altShiftDev opened this issue Mar 21, 2018 · 0 comments

Comments

@altShiftDev
Copy link

Quasar: v0.15.6
Browsers: Any
Any other software related to your bug:

What did you get as the error?

No error, this is a request to bring back the DEV vs Prod documentation page found on old quasar releases (http://v0-14.quasar-framework.org/guide/app-dev-vs-production-code.html)

What were you expecting?

I find this page is very useful and there's an easy workaround for adapting the if (DEV) statement into v0.15.8 and wanted to share it with the community:

Old method:

someFunction() {
    if (DEV) {
      console.log('DEV!)
    }
    // Alternatively: if (PROD) ...
}

New method:

someFunction() {
    if (process.env.DEV) {
      console.log('DEV!)
    }
    // Alternatively: if (process.env.PROD) ...
}

You can also use this flag in the <template> area with v-if/v-show by binding it to a variable in your data property:

<template>
      <div>
          <span v-if="isDev">This is the DEV environment</span>
          <span v-if="!isDev">This is the PROD environment</span>
      </div>
</template>

export default {
  data () {
    return {
      isDev: process.env.DEV
    }
  }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant