Yi 3 년 전
부모
커밋
23d77b7f76
1개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. 12 2
      demo/4-3/index.html

+ 12 - 2
demo/4-3/index.html

@@ -7,11 +7,21 @@
 </head>
 <body>
   <div id="app">
-    <child></child>
+    <child content="hello world"></child>
   </div>
   <script>
     Vue.component('child',{
-      template: '<div>Child</div>'
+      props: {
+        content: {
+          type: [String,Number],
+          required: false,
+          default: "default value",
+          validator: function(value){
+            return (value.length > 5)
+          }
+        }
+      },
+      template: '<div>{{content}}</div>'
     })
 
     var vm = new Vue({