【已解决】[Vue warn]: Property or method “klass“ is not defined on the instance but referenced during ren

报错:[Vue warn]: Property or method “klass” is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

报错原因:

绑定数据{{klass}}没有在data中定义

解决方法:

data中定义一个klass即可

你可能感兴趣的:(vue.js,javascript,前端)