title: Raw expression in Vue.js: error in computing class dynamically
body: <p>In vue.js 2.0 I'm trying to make a compute a class like this:</p>
  <pre><code> &lt;li :class=&quot;'str1'   calcStarClass(1, p.rtg)&quot;&gt;                                               &lt;/li&gt;
  </code></pre>
  <p>And in methods I have:</p>
  <pre><code>methods: {
       calcStarClass(starNum, rating) {
           switch (starNum) {
               case 1:
                   switch (rating) {
                       case (rating == 0):
                           return &quot;str&quot;
                           break;
                       case (0 &lt; rating &lt; 1):
                           return &quot;strh&quot;
                           break;
                       case (rating &gt;= 1):
                           return &quot;strf&quot;
                           break;
                       default:
                           return &quot;strf&quot;
                   }
                   break;
               case 2: ...
  </code></pre>
  <p>But I get this error:</p>
  <pre><code>Raw expression: :class=&quot;'str1'   calcStarClass(1, p.rtn)&quot;
  </code></pre>
  <p>When I try <code>&lt;li v-bind:class=&quot;'str1'   calcStarClass(1, p.rtg)&quot;&gt;</code> instead, I get this error:</p>
  <pre><code>invalid expression: Unexpected identifier in
  
      'str1'   calcStarClass(1, p.rtg)
  
    Raw expression: v-bind:class=&quot;'str1'   calcStarClass(1, p.rtg)&quot;
  </code></pre>
  <p>I'm wondering what casuse this error and how can I fix it?</p>