Ver código fonte

Rewrites props in notes to do type validation.

Christopher Leggett 5 anos atrás
pai
commit
a303bee78b
2 arquivos alterados com 36 adições e 2 exclusões
  1. 18 1
      public/js/app.js
  2. 18 1
      resources/js/components/notes.vue

+ 18 - 1
public/js/app.js

@@ -2615,7 +2615,24 @@ __webpack_require__.r(__webpack_exports__);
 
 /* harmony default export */ __webpack_exports__["default"] = ({
   mixins: [_mixins_dateMixin__WEBPACK_IMPORTED_MODULE_0__["default"]],
-  props: ['initialnotes', 'authusername', 'noteType', 'woid'],
+  props: {
+    initialnotes: {
+      type: Array,
+      "default": []
+    },
+    authusername: {
+      type: String,
+      required: true
+    },
+    noteType: {
+      type: Number,
+      required: true
+    },
+    woid: {
+      type: Number,
+      required: true
+    }
+  },
   data: function data() {
     return {
       notes: this.initialnotes,

+ 18 - 1
resources/js/components/notes.vue

@@ -40,7 +40,24 @@
 import dateMixin from '../mixins/dateMixin'
 export default {
     mixins:[dateMixin],
-    props: ['initialnotes', 'authusername', 'noteType', 'woid'],
+    props: {
+        initialnotes: {
+            type: Array,
+            default: [],
+        },
+        authusername: {
+            type: String,
+            required: true,
+        },
+        noteType: {
+            type: Number,
+            required: true,
+        },
+        woid: {
+            type: Number,
+            required: true,
+        }
+    },
     data () {
         return {
             notes: this.initialnotes,