Created
March 29, 2019 07:56
-
-
Save simonwuyts/810634e3f57c3673e7d756b07d2f7e02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<svg width="500" height="500"> | |
</svg> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
flowers: [ | |
{ | |
name: 'Roses', | |
amount: 25, | |
color: '#cc2936' | |
}, | |
{ | |
name: 'Tulips', | |
amount: 40, | |
color: '#f2c640' | |
}, | |
{ | |
name: 'Daisies', | |
amount: 15, | |
color: '#2a93d4' | |
}, | |
{ | |
name: 'Narcissuses', | |
amount: 9, | |
color: '#F7AD0A' | |
} | |
] | |
} | |
}, | |
computed: { | |
transformedFlowerData() { | |
return { | |
name: 'Top Level', | |
children: this.flowers.map(flower => ({ | |
...flower, | |
parent: 'Top Level' | |
})) | |
} | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment