title: Vue.js component not working
body: <p>I can't seem to figure out how to make components work. Without the component it works fine (the commented code).</p>
  
  <p>Here's my HTML:</p>
  
  <pre><code>&lt;strong&gt;Total Price:&lt;/strong&gt; &lt;span v-text="total"&gt;&lt;/span&gt;&lt;br&gt;
  &lt;strong&gt;CPC:&lt;/strong&gt; &lt;span v-text="cpc"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>Here's my Vue.js code:</p>
  
  <pre><code>Vue.component('my-component', {
      // data: function() {
      //     return { interval: 0, exposure: 0, clicks: 0, total: 0, cpc: 0 }
      // },
      computed: {
          total: function () {
              return(this.clicks * (this.exposure * 0.001 / 10) / 700).toFixed(8)
          },
          cpc: function () {
              return((this.total) / (this.clicks &gt; 0 ? this.clicks : 1)).toFixed(8)
          }
      }
  });
  
  const app = new Vue({
      el: '#app',
      data: {
          interval: 0, exposure: 0, clicks: 0, total: 0, cpc: 0
      },
      // computed: {
      //     total: function () {
      //         return(this.clicks * (this.exposure * 0.001 / 10) / 700).toFixed(8)
      //     },
      //     cpc: function () {
      //         return((this.total) / (this.clicks &gt; 0 ? this.clicks : 1)).toFixed(8)
      //     }
      // }
  });
  </code></pre>
  
  <p>1) This doesn't work unless I uncomment the commented code.</p>
  
  <p>2) JSFiddle: <a href="http://jsfiddle.net/tjkbf71h/3/" rel="nofollow noreferrer">http://jsfiddle.net/tjkbf71h/3/</a></p>