var vm = new Vue({
    alert: function(msg) {
        alert(msg)
    }
    , el: '#shoppingCar'
	, data: {
        cartList: []
        , allChecked: false
	}
	, created: function () {
        this.$on('onselect', this.alert); // not be applied yet
	}
	, mounted: function() {
		this.$nextTick(function(){
			this.loadCart()
		})
	}
	, computed: {

	}
	, methods: {
		loadCart: function() {
            var self = this;
			this.$http.post('data/inventory.json').then(function(response) {
				// console.log(response)
                self.cartList = response.body
			})
		}
        , getPrice: function (item) {
            return item.price * item.quantity
        }
		, toggleItem: function (item, force/*optional*/) { // 切換當前商品選取狀態，或者強迫(不）選取
            if (typeof item.isChecked == "undefined") {
                this.$set(item, 'isChecked', false)
            }
            if (force == undefined) {
                item.isChecked = !item.isChecked;
            } else {
                item.isChecked = force
            }
		}
        , checkAll: function (isAllChecked) {
            this.allChecked = isAllChecked;
            this.cartList.forEach(function (item) {
                this.toggleItem(item, isAllChecked)
            }, this)
        }
        , deleteItem: function(item) {
            var index = this.cartList.indexOf(item); // using id will be better
            this.cartList.splice(index,1); // alternate in place
        }
        , totalMoney: function () {
            var total = 0;
            this.cartList.forEach(function(item){
                if (item.isChecked)
                    total += this.getPrice(item);
            }, this); // this is vm
            return total;
        }
	}
});

@@ -89,17 +89,20 @@
 ingCar'%0A
-%09
+    
 , data: 
@@ -152,20 +152,26 @@
 : false%0A
-%09%7D%0A%09
+    %7D%0A    
 , create
@@ -251,20 +251,26 @@
 ied yet%0A
-%09%7D%0A%09
+    %7D%0A    
 , mounte
@@ -285,18 +285,24 @@
 ion() %7B%0A
-%09%09
+        
 this.$ne
@@ -320,19 +320,28 @@
 tion()%7B%0A
-%09%09%09
+            
 this.loa
@@ -352,17 +352,29 @@
 t()%0A
-%09%09%7D)%0A%09%7D%0A%09
+        %7D)%0A    %7D%0A    
 , co
@@ -388,12 +388,18 @@
  %7B%0A%0A
-%09%7D%0A%09
+    %7D%0A    
 , me
@@ -407,18 +407,24 @@
 hods: %7B%0A
-%09%09
+        
 loadCart
@@ -467,19 +467,28 @@
 = this;%0A
-%09%09%09
+            
 this.$ht
@@ -548,12 +548,24 @@
 ) %7B%0A
-%09%09%09%09
+                
 // c
@@ -635,16 +635,31 @@
 ody%0A
-%09%09%09%7D)%0A%09%09
+            %7D)%0A        
 %7D%0A  
@@ -750,18 +750,24 @@
       %7D%0A
-%09%09
+        
 , toggle
@@ -1121,10 +1121,16 @@
   %7D%0A
-%09%09
+        
 %7D%0A  
@@ -1821,9 +1821,12 @@
   %7D%0A
-%09
+    
 %7D%0A%7D)

convert tabs to space