D
D
danilr2020-02-22 16:24:59
Vue.js
danilr, 2020-02-22 16:24:59

What's wrong with v-bind?

<div @click="handleClick" :class="class" class="button-wrapper">

computed: {
  class() {
    return {
      "button-red": this.color === "red",
      "button-gray": this.color === "gray"
    };
  }
}

Swears at :class="class":

[vue/valid-v-bind]
'v-bind' directives require an attribute value.

[vue/no-parsing-error]
Parsing error: Unexpected end of expression.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Koltunov, 2020-02-22
@danilr

Rename the computed property, say to 'classes'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question