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.
- Host: GitHub
- URL: https://github.com/lucien144/vue-dump-filter
- Owner: lucien144
- License: mit
- Created: 2019-01-31T03:46:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-31T04:44:34.000Z (over 7 years ago)
- Last Synced: 2025-12-07T23:45:36.433Z (7 months ago)
- Topics: console, dump, log, logger, logging, vue, vuejs
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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`

### `this.$dump`
