Vue 组件中使用 $refs 时,typescript 无法识别而抛出错误。
    image.png
    我们可以通过在当前类中申明 $refs 的所有引用:

    1. /**
    2. * 解决 ts 无法识别 vue 中的 $refs
    3. */
    4. public $refs!: {
    5. editor: TinyEditor
    6. }

    这样,typescript 就能识别了。