var Player = {
template: '#player-template',
methods: {
play: function () {
alert('play')
}
}
}
new Yox({
el: '#app',
template: '#template',
methods: {
play: function () {
this.$refs.player.play()
}
},
components: {
Player: Player
}
})
<div id="app"></div>
<script id="player-template" type="text/plain">
<div class="player">
Player
</div>
</script>
<script id="template" type="text/plain">
<div>
<button on-click="play()">
Play
</button>
<Player ref="player" />
</div>
</script>