Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vue.component('child-component', {
- template: '<div>Child</div>',
- mounted() {
- this.$emit('test');
- },
- methods: {
- onClick: function() {
- this.$emit('child-click-on');
- }
- }
- });
- var vm = new Vue({
- el: '#app',
- created: function () {
- this.$on('test', function () {
- console.log('test-on');
- });
- this.$on('child-click', function () {
- console.log('child-click-on');
- });
- }
- });
Add Comment
Please, Sign In to add comment