Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div>
- <p>{{category}}</p> //afisa obiectul de categorie OK
- <p>{{localCategory}}</p> //afisa obiect gol {}
- </div>
- </template>
- props: {
- category: {
- type: Object,
- required: true
- }
- }
- data () {
- return {
- //localCategory: Object.assign({}, this.category)
- localCategory: JSON.parse(JSON.stringify(this.category))
- }
- }
- //partinte
- data() {
- return {
- category: {}
- }
- },
- created() {
- this.$store.dispatch('category/fetchCategory', this.$route.params.id)
- .then((response) => {
- this.category = response
- })
- .catch(error => {
- console.log(error)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement