Call method from component inside component's <slot></slot>
问题 I'm learning Vue.js and I'm struggling to find a way to organize my code. I'm trying to make everything as modular as possible, so when making a slider i did the following: <template> <div class="banners"> <slot></slot> </div> </template> <script> export default { methods: { echo() { console.log('Echoing..') } }, mounted() { $('.banners').slick(); } } </script> And in my view I simply use the component: <banners> <?php for ($i = 0; $i < 5; $i++) : ?> <img src="http://lorempixel.com/1440/500"