今天写在使用vue3+ts做其他尝试时,编译忽然报错。错误全是
Property 'XXXX' does not exist on type 'ComponentPublicInstance<{}, {}, {}, {}, {}, EmitsOptions, {}, {}, false, ComponentOptionsBase<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, {}>>'.
当时就一脸懵逼。逐步后撤排查,发现是增加computed后导致。将里面的属性清空,正常,那么就是属性return出问题了。直接return空字符串是正常的。出错的是
调试后发现,是方法没注明返回值。-_-。经验还是太少了。