title: How to define a variable in vue component ? (Vue.JS 2)
body: <p>My vue component is like this :</p>
  
  <pre><code>&lt;template&gt;
      &lt;div&gt;
          &lt;div class="panel-group"v-for="item in list"&gt;
              &lt;div class="col-md-8"&gt;
                  &lt;div class="alert"&gt;
                      {{ status = item.received_at ? item.received_at : item.rejected_at }}
                      &lt;p v-if="status"&gt;
                          {{ status }} - {{ item.received_at ? 'Done' : 'Cancel' }}
                      &lt;/p&gt;
                      &lt;p v-else&gt;
                          Proses
                      &lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
      export default {
          ...
          computed: {
              list: function() {
                  return this.$store.state.transaction.list
              },
              ...
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I want define the <code>status</code> variable </p>
  
  <p>So, the <code>status</code> variable can be used in condition</p>
  
  <p>I try like this :</p>
  
  <pre><code>{{ status = item.received_at ? item.received_at : item.rejected_at }}
  </code></pre>
  
  <p>But, seems it was wrong</p>
  
  <p>How I define it correctly?</p>