zoukankan      html  css  js  c++  java
  • vuejs on

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>vue</title>
    
         <!-- 
        <script src="vue.js"></script>
        -->
        
     <script src="https://unpkg.com/vue/dist/vue.js"></script>
     <script src="https://unpkg.com/lodash@4.13.1/lodash.min.js"></script>
    </head>
    <body> 
     
     <div id="counter-event-example">
      <p>{{ total }}</p>
      <button-counter v-on:increment v-on:incrementTotal></button-counter>
      <button-counter v-on:increment="incrementTotal"></button-counter>
    </div>
     
    <script>
    Vue.component('button-counter', {
      template: '<button v-on:click="increment">{{ counter }}</button>',
      data: function () {
        return {
          counter: 0
        }
      },
      methods: {
        increment: function () {
          this.counter += 1
          this.$emit('increment')
        }
      },
    })
    
    
    
    new Vue({
      el: '#counter-event-example',
      data: {
        total: 0
      },
      methods: {
        incrementTotal: function () {
          this.total += 1
        }
      }
    })
    </script>
    
    
    
    </body>
    </html>
  • 相关阅读:
    GET和POST两种基本请求方法的区别
    GET与POST类型接口
    TCP连接与断开详解(socket通信)
    QC02
    QC01
    tcp三次握手和四次挥手
    ssh整合
    redis主从切换
    缓存解释(一级缓存,二级缓存)
    cxf整合spring代码
  • 原文地址:https://www.cnblogs.com/rojas/p/6595480.html
Copyright © 2011-2022 走看看