版本变动html
slotvue
父子组件交互webpack
var child = { created: function(){ this.$on('click-child', function(){ console.log('send ajax here'); }); }, template: '<div></div>' }; var app = { template: '<div><button v-on:click="clickParent">点击</button><child v-ref:child></child><div>', methods: { clickParent: function(){ this.$refs.child.$emit('click-child'); } }, components: { child: child } };
组件web
处理边界状况ajax