vue- dynamic properties

 

<template>
    <div>
        <a :href="url">{{msg}}</a>    
    </div>   
</template>

        data() {
            return {
                msg: "百度一下",
                url: "https://www.baidu.com"          
            };
        },

 

Medel-realization v 
@input: change the input values will trigger events 
< Template > 
    < div > 
        < the INPUT of the type = "text" : value = "msg" @input = "handle" >    
    </ div >    
</ Template > 

< Script > 
    Export default { 
        name: " the HelloWorld " , 
        The props: { 
            
        }, 
        Data () { 
            return { 
                MSG: " Baidu, "
            };
        },
        methods: {
            handle:function(){
                this.msg = $event.target.value
            }
        }
    };
</script>

Guess you like

Origin www.cnblogs.com/theShyer/p/12163568.html