Skip to content

Instantly share code, notes, and snippets.

@bertoni
bertoni / metodo-fracamente-acoplado.vue
Created June 29, 2018 14:17
Fraco acoplamento vue
<template>...</template>
<script>
export default {
name: 'SomeComponent',
methods: {
removeWithSuccess(someReturnedData) {
/* Some implementation for success case */
},
removeWithFail(error) {
/* Some implementation for fail case */
@bertoni
bertoni / metodo-fortemente-acoplado.vue
Created June 29, 2018 14:11
Forte acoplamento vue
<template>...</template>
<script>
export default {
name: 'SomeComponent',
methods: {
remove () {
this.$store.dispatch('removeSomething', this.id)
.then(() => {
/* Some implementation for success case */
})
@bertoni
bertoni / using-vue-notification-in-action-vuex.js
Last active June 29, 2018 14:31
Vue-notification in the action VUEX
# src/vuex/actions.js
export default {
...
notify: (store, data) => {
Vue.prototype.$notify({
group: (data.group || 'general'),
type: (data.type || 'warn'),
duration: (data.time || 6000),
speed: (data.speed || 1000),
@bertoni
bertoni / html2canvasAndjsPDF.vue
Last active May 20, 2022 13:59
html2canvas and jsPDF in action
<template>
<div id="app">
<img src="./assets/logo.png">
<router-view/>
<button @click="download">Download</button>
<div id="pdf"></div>
</div>
</template>
<script>