Skip to content

Commit

Permalink
style: onlyProd renamed to productionOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Chaptsev committed Dec 5, 2017
1 parent 676ef94 commit b5e5851
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ Pass the VueRouter instance to the plugin and let it handle everything for you:

**Options**:

| Name | Description | Required | Default |
| ------------------- | ----------------------------------------------------------------- | ---------- | ------------------------------------------------ |
| id | Your tracking id | True | null |
| router | VueRouter object | True | null |
| env | "production" or "development" | False | [process.env.NODE_ENV] || "production" |
| onlyProd | Do not track a page visit if env !== "production" | False | true |
| ignoreRoutes | List of ignored routes names | False | [] |
| skipSamePath | Do not track a page visit if previous and next routes URLs match | False | false |
| Name | Description | Required | Default |
| -------------- | ----------------------------------------------------------------- | -------- | ------------------------------------------------ |
| id | Your tracking id | True | null |
| router | VueRouter object | True | null |
| env | "production" or "development" | False | [process.env.NODE_ENV] || "production" |
| productionOnly | Do not track a page visit if env !== "production" | False | true |
| ignoreRoutes | List of ignored routes names | False | [] |
| skipSamePath | Do not track a page visit if previous and next routes URLs match | False | false |


You are also able to use [Metrika API] wherever you want to:
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let config = {
router: null,

env: null,
onlyProd: true,
productionOnly: true,
ignoreRoutes: [],
skipSamePath: false
}
Expand Down
4 changes: 2 additions & 2 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export function loadScript () {
export function createMetrika (Vue) {

// Creates Metrika
if (config.onlyProd && config.env !== "production") {
return console.log('[vue-yandex-metrika] Tracking is disabled, because onlyProd option is true and env option is', config.env)
if (config.productionOnly && config.env !== "production") {
return console.log('[vue-yandex-metrika] Tracking is disabled, because productionOnly option is true and env option is', config.env)
}

return Vue.prototype.$metrika = Vue.$metrika = new Ya.Metrika({id: config.id})
Expand Down

0 comments on commit b5e5851

Please sign in to comment.