码迷,mamicode.com
首页 > 其他好文 > 详细

vue

时间:2018-09-05 08:54:07      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:set   for   char   3.3   tps   before   style   hide   code   

 

vue与jquery比较

vue

技术分享图片
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue </title>
<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div id="app">
  <p>{{ message }}</p>
  <button v-on:click="clickfunc">点击</button>

</div>

<script>
new Vue({
    el:#app,
    data:{
        message:before
    },
    methods:{
        clickfunc:function () {
            this.message=after
        }
    }


})


</script>
</body>
</html>
View Code

jquery

技术分享图片
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <p  id="pp">before</p>
    <button id="bt">点击</button>
</div>

<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script>
    $(#bt).click(function () {
        $(#pp).text(after);
    })
</script>

</body>
</html>
View Code

 

vue

标签:set   for   char   3.3   tps   before   style   hide   code   

原文地址:https://www.cnblogs.com/infaaf/p/9589560.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!