注册一个全局组件component子级Vue.component("vm-page",{props:{isShow:{type:Boolean,default:true}},wacth:{isShow(val){console.log(val)}},mounted(){this.perPage();},data:function(){},methods:{perPage(){vardata=[{key:"20",value:"20条/每页"},{key:"50",value:"50条/每页"},{key:"100",value:"100条/每页"}];varoptions=[];data.forEach(function(item,index){varoption=''+item.value+""; options.push(option);});$("#pk_bet_pages")[0].innerHTML=options.join("");$("#pk_bet_pages").selectpicker("refresh");},makePage(){varpageSizes=$("#pk_bet_pages").val()*1;this.$emit("pageSizes",pageSizes);}},componentUpdated(){console.log(12345,"12345");},template:`
data-live-search="true">
`});父级0">
newVue({el:"#money",data(){return{parmas:{page:1,//当前页数pageSize:100,//每页数据量totalCount:0//总数据量},list:[],pageSizes:20,};},methods:{hasPages(pageSizes){console.log(pageSizes,'123456')},}});遇到的问题父级的list长度改变之后,子级无法监听到list的长度大于0并返回true子级发射的事件父级接收不到希望大佬指教一下,谢谢
偶然的你
侃侃尔雅
相关分类