Dump filter for Vue
Installation
$ npm i @lucien144/vue-dump-filter
Usage
You can use it as a Vue filter: |dump
// component.vue
<template>
{{ title|dump }}
</template>
Additionally you can use it as a Vue instance method $dump()
// component.vue
<template>
<input type=text @keyup="$dump">
</template>
<script>
export default {
methods: {
login(username) {
this.$dump(username);
}
}
}
</script>
console.log
?
What's the difference between - You can't use
console.log
in the template section of single file components. - 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: