vue.js v-model的运算

2021-03-02 15:43:27 浏览数 (1)

代码语言:javascript复制
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<script type="text/javascript" src="./vue.min.js"></script>
	<title></title>
</head>
<body>
	<input type="" name="" v-model='left'>-
	<input type="" name="" v-model='right'>
	{{left-right}}
	<script type="text/javascript">
		new Vue(
			{
				el:'body',
				data:{
					left:'',
					right:''
				}
			}
		);
	</script>
</body>
</html>

解释:

代码语言:javascript复制
{{left-right}}

神来之笔

效果:

0 人点赞