Vue props verification did not respond.

the first time I came into contact with vue, I learned the following example of props verification. Why do I verify a number and give it a string without reporting an error?

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
</head>
<body>
<div id="app1">
    

{{message}}

<!-- v-on @--> <!-- v-bind: :--> <first-com mss1="hello world!" :mss2="forCom"></first-com> </div> </body> <script src= "http://unpkg.com/vue@2.5.17/dist/vue.min.js"></script> <script src= "index.js"></script> <script type="text/javascript"> Vue.component("first-com", { props: { mss1:String, mss2:{ type:Number, //**** required:true } }, template: "<div>{{mss1}}{{mss2}}</div>", }) var v1 = new Vue({ el: "-sharpapp1", data: { message: "", forCom: "" } }) </script> </html>
Mar.07,2022

you are using production version it removes warnings, Popes validation Vue will only warn you in the browser console, it will not affect the component to run


the vue you introduced here cannot see the error warning in the compressed version. You can switch to an uncompressed version

  

the first floor has already answered for you

Menu