Vuejs typescript this.$refs..value does not exist

前端 未结 7 1475
野的像风
野的像风 2020-11-30 13:33

While rewriting my VueJs project in typescript, I came across a TypeScript error.

This is a part of the component that has a custom v-model.

An input field i

7条回答
  •  臣服心动
    2020-11-30 14:00

    I found a way to make it work but it is ugly in my opinion.

    Feel free to give other/better suggestions.

    update() {
        this.$emit('input', {
            plate: (this.$refs.plate).value,
        });
    }
    

提交回复
热议问题