解决方案一: 开发阶段 const { ctx } = getCurrentInstance() 生产阶段 const {proxy} = getCurrentInstance() ctx相当于Vue2的this,我们都知道vue3中不支持this。所以把ctx改成proxy. 解决方案二:as any const {proxy} = getCurrentInstance() as any