소스 검색

update examples with new computed shorthand

Evan You 12 년 전
부모
커밋
a1bee31378
4개의 변경된 파일18개의 추가작업 그리고 28개의 파일을 삭제
  1. 6 8
      examples/firebase/app.js
  2. 4 8
      test/functional/fixtures/nested-props.html
  3. 2 4
      test/functional/fixtures/share-data.html
  4. 6 8
      test/functional/fixtures/validation.html

+ 6 - 8
examples/firebase/app.js

@@ -32,16 +32,14 @@ var app = new Vue({
         }
         }
     },
     },
     computed: {
     computed: {
-        isValid: {
-            $get: function () {
-                var valid = true
-                for (var key in this.validation) {
-                    if (!this.validation[key]) {
-                        valid = false
-                    }
+        isValid: function () {
+            var valid = true
+            for (var key in this.validation) {
+                if (!this.validation[key]) {
+                    valid = false
                 }
                 }
-                return valid
             }
             }
+            return valid
         }
         }
     },
     },
     methods: {
     methods: {

+ 4 - 8
test/functional/fixtures/nested-props.html

@@ -35,15 +35,11 @@
                     }
                     }
                 },
                 },
                 computed: {
                 computed: {
-                    d: {
-                        $get: function () {
-                            return this.msg + (this.a.b.c || '') + (this.a.c || '')
-                        }
+                    d: function () {
+                        return this.msg + (this.a.b.c || '') + (this.a.c || '')
                     },
                     },
-                    sum: {
-                        $get: function () {
-                            return this.hidden.a + this.hidden.b
-                        }
+                    sum: function () {
+                        return this.hidden.a + this.hidden.b
                     }
                     }
                 },
                 },
                 methods: {
                 methods: {

+ 2 - 4
test/functional/fixtures/share-data.html

@@ -44,10 +44,8 @@
                     shared: shared
                     shared: shared
                 },
                 },
                 computed: {
                 computed: {
-                    source: {
-                        $get: function () {
-                            return JSON.stringify(this.shared)
-                        }
+                    source: function () {
+                        return JSON.stringify(this.shared)
                     }
                     }
                 }
                 }
             })
             })

+ 6 - 8
test/functional/fixtures/validation.html

@@ -45,16 +45,14 @@
                     }
                     }
                 },
                 },
                 computed: {
                 computed: {
-                    isValid: {
-                        $get: function () {
-                            var valid = true
-                            for (var key in this.validation) {
-                                if (!this.validation[key]) {
-                                    valid = false
-                                }
+                    isValid: function () {
+                        var valid = true
+                        for (var key in this.validation) {
+                            if (!this.validation[key]) {
+                                valid = false
                             }
                             }
-                            return valid
                         }
                         }
+                        return valid
                     }
                     }
                 },
                 },
                 methods: {
                 methods: {