36 lines
735 B
HTML
36 lines
735 B
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>Document</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="app" >
|
||
|
{{fullname}}
|
||
|
</div>
|
||
|
</body>
|
||
|
<script src="../JavaScript/vue.min.js"></script>
|
||
|
<script>
|
||
|
let vue=new Vue({
|
||
|
el:"#app",
|
||
|
data:{
|
||
|
family_Name:"陈",
|
||
|
Name:"天恩"
|
||
|
},
|
||
|
computed:{
|
||
|
fullname:{
|
||
|
set:function(val){
|
||
|
let string=val.split(" ");
|
||
|
this.family_Name=string[0]
|
||
|
this.Name=string[1]
|
||
|
},
|
||
|
get:function(){
|
||
|
return this.family_Name+" "+this.Name
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
</script>
|
||
|
</html>
|