1、我用$emit方法去實現(xiàn)子組件調(diào)用父組件方法的功能,開始的時候都能正常使用,但是后來我在下面的代碼中就無法觸發(fā)了,網(wǎng)上說是方法大小寫的原因,但是改了之后還是不行~代碼如下: editCreditApi(params).then((res) => { let rowId = this.$store.state.rowId; let status = this.$store.state.productStatus; let productType = this.$store.state.dialogType; let params = { id: rowId } if (status == '草稿') { creditreferAPI(params).then((res) => { **this.$emit('getFundList','edit');** }) } }) 但是,把這段代碼放到外面就能正常調(diào)用:不知道大家有沒有遇到這種情況,或者是知道是這種情況是什么原因?qū)е碌?,如能解惑,萬分感激!ps:大家都覺得是this的指向問題導(dǎo)致的,但是我在外面用that把this存起來,再去調(diào)用還是不行~
vue中$emit事件無法觸發(fā)。
慕虎7371278
2018-12-27 22:19:58