Se muestra el gráfico y todo está bien, pero no entiendo cómo transferir mis valores ingresados en la entrada.
la actualización parece ser correcta, pero si la actualizo no cambia nada, y los datos no se actualizan
Página.vue
<script> import PieExample from '../components/PieExample' export default { components: { PieExample, }, data () { return { myMoney: null, USD: 0, ETH:0, BTC:0 } }, methods: { addMoney() { this.USD += this.myMoney this.ETH += this.myMoney * 0.0003 this.BTC += this.myMoney * 0.000017 }, takeMoney() { this.USD -= this.myMoney this.ETH -= this.myMoney * 0.0003 this.BCT -= this.myMoney * 0.000017 }, }, } </script>PieExample.js
import { Pie } from 'vue-chartjs' export default { extends: Pie, mounted () { this.renderChart({ labels: ['backs', 'uin', 'Rub'], datasets: [ { backgroundColor: [ '#41B883', '#E46651', '#00D8FF', ], data: [1,1,1] } ] }, {responsive: true, maintainAspectRatio: false}) } }Según la documentación de vue-chartjs , no debe incluir una etiqueta de plantilla en el componente en el que representa su gráfico porque eso no funcionará:
Template Tag can not be merged Do not include the <template> tag in your .vue single-file components. Vue can not merge templates. If you add an empty <template> tag, Vue will take the template from your component and not from the extended one, which will result in an empty template and unexpected errors.Por lo tanto, deberá crear un componente secundario para su gráfico en el que no incluya una etiqueta de script que incluya en su archivo principal