<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="vue.js"></script>
</head>
<body>
<h1>初始化多个vue实例对象</h1>
<div ></script>
</body>
</html>

 

 

 

 

v-oj.js

var one = new Vue({
el:"#vue-app-one",
data:{
title:"one当中的内容",
},
methods:{

},
computed:{
greet:function(){
return "hello App one"
}
}
});


var two = new Vue({
el:"#vue-app-two",
data:{
title:"two当中的内容"
},
methods:{
changeTitle:function(){
one.title="已经改名";
}
},
computed:{
greet:function(){
return "hello App two"
}
}
});
two.title="app two 也发生变化";

相关文章:

  • 2022-12-23
  • 2021-03-31
  • 2022-12-23
  • 2021-09-05
  • 2021-12-27
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
相关资源
相似解决方案