New to vuejs, just trying to play around. I have an object with values that I want to post in my template.
export default {
name: 'frontPage',
data : function() {
return {
}
},
methods : {
player () {
this.lvl = 1;
this.df = this.lvl * 1.3;
this.hp = this.lvl * 100 / 3;
this.ap = this.hp/10;
this.name = 'Guest';
}
},
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<h2 id="name">
{{ player.name }}
</h2>
<h2 id="lvl">
{{ player.lvl}}
</h2>