v-on的用法,v-on:click=“count ++“

DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Documenttitle>
    <script src="../../vue.js/vue.js">script>
  head>
  <body>
    
    <div id="app">
      {{ message }}
      <br>
      
      <button-counter>button-counter>
    div>

    <script>
      Vue.config.productionTip = false;
      Vue.component('button-counter',{
        data:function(){
          return {count:0,}
        },
        template:``,
      }
      )

      let vm=new Vue(
        {
          el:'#app',
          data:{
            message:'welcome to HNU administrater of college'
          },
        }
      );

      function a()
        {
          return {
            aa:1,
            bb:2,
          }
        };

      let xd=a();
      let xd1 = a();

    script>
  body>
html>

你可能感兴趣的:(前端,javascript,前端,vue.js)