Skip to content

Instantly share code, notes, and snippets.

@alexmoreno
Last active March 24, 2017 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmoreno/1468cba53a22b1df80f6b10db9acf53f to your computer and use it in GitHub Desktop.
Save alexmoreno/1468cba53a22b1df80f6b10db9acf53f to your computer and use it in GitHub Desktop.
mounted() {
let startingPromises = [
this.$store.dispatch('produtos/load_marcas_data'),
this.$store.dispatch('produtos/load_categorias_data'),
this.$store.dispatch('produtos/load_produtos_tipo_data'),
this.$store.dispatch('produtos/load_tags_data'),
]
Promise.all(startingPromises).then((resolve) => {
this.$nextTick(function () {
var vm = this
jQuery('textarea.editor').summernote({
height: 200,
callbacks: {
onChange: function(contents, $editable) {
vm.model.descricao = contents;
}
}
});
});
if(this.$route.params.id > 0) {
this.produtoAccess = true;
this.disabled_items = []
this.titulo = "Editar "+this.titulo;
this.$store.dispatch('produtos/load', this.$route.params.id).then((response) => {
this.prepareLoadedProduto(response)
})
} else {
this.produtoAccess = false;
this.$store.dispatch('produtos/reset');
this.titulo = "Adicionar "+this.titulo;
}
}, (reject) => {
dialog.alertFlutuante('erro', "O sistema está com problemas, contate o administrador do sistema.")
})
//this.$store.dispatch('produtos/load_atributos_data')
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment