An open API service indexing awesome lists of open source software.

https://github.com/lucien144/vue-dump-filter

🐞 Tiny logger for Vue.
https://github.com/lucien144/vue-dump-filter

console dump log logger logging vue vuejs

Last synced: 5 months ago
JSON representation

🐞 Tiny logger for Vue.

Awesome Lists containing this project

README

          

# Dump filter for Vue
🐞 Tiny logger for Vue you can use in templates.

## Installation
```sh
$ npm i @lucien144/vue-dump-filter
```

```js
import VueDump from '@lucien144/vue-dump-filter';
Vue.use(VueDump, { production: process.env.NODE_ENV === 'production' });
```

## Usage

You can use it as a Vue filter: `|dump`

```vue
// component.vue

{{ title|dump }}

```

Additionally you can use it as a Vue instance method `$dump()`
```vue
// component.vue

export default {
methods: {
login(username) {
this.$dump(username);
}
}
}

```

## What's the difference between `console.log`?
1. You can't use `console.log` in the template section of single file components.
1. When dumping reactive objects using `console.log` all values are usually hidden behind `...`. You also output all getters and setters. The `$dump` dumps plain object:

### `console.log`
![http://144.wtf/NrCSHF+](http://144.wtf/NrCSHF+)

### `this.$dump`
![http://144.wtf/VvpDmk+](http://144.wtf/VvpDmk+)