VUE框架的插值操作补充
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="vue3.js"></script>
</head>
<body>
<div id="app">
<p>消息:{{msg}}</p>
<p>网站:<span v-html="link"></span></p>
<input type="text" v-model="data">
<input type="text" v-model="msg">
<p>
<a :href="link2">{{site}}</a>
网站名称 <input type="text" v-model="site">
url地址 <input type="text" v-model="link2">
</p>
<p>年龄: {{age+1}}</p>
<p>{{is_login?"呼长喜":"登录"}}</p>
<p>{{citys.split(" ").reverse().join(",")}}</p>
</div>
<script>
// @click="foo" 点击功能
// 数据驱动界面
var vm = Vue.createApp({
data(){
return {
msg: "hello huchangxi", //点击操作的内容
link: "<a href=''>百度</a>",
data: "12345",
url: "https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png",
site: "百度",
link2: "https://img0.baidu.com/it/u=512340543,3139277133&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=281",
age: 23,
is_login: false,
citys:"北京 上海 深圳 广州"
}
},
}).mount("#app")
</script>
</body>
</html>
![](https://img2022.cnblogs.com/blog/1413093/202206/1413093-20220609210117232-1321179334.png)