The basic syntax for using the difference Vue event

"V-on:" can be abbreviated as "@"

"Click" Click

"Dblclick" double plus

Code:

 

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="vue.js"></script>
    <title id="title">{{title}}</title>
</head>
<body>
<div id="ask"><!--vue不能控制body和html的标签-->
    <ul>
        <li v-for="(v,k) in list">
           {{v.id}} ===== {{v.content}}
            <button @click="remove(v.id)">单击</button>
            <button @dblclick="remove(v.id)">双击</button>

        </li>
    </ul>
</div>
<script>
    var vue = function (options){new Vue(options)};
    VUE ({
        EL: '#title' , 
        Data: { 
            title: 'Basic syntax using the difference Vue event' 
        } 
    }); 
    var App = VUE ({ 
        EL: '#ask' , 
        Data: { 
            search_content: '' , 
            Content: ' ' , 
            List: [ 
                { ' ID ':. 3,' Content ':' ask.mykeji.net ' }, 
                { ' ID ':. 5,' Content ':' simple record ' }, 
                { ' ID ': 2,' content ':' personal blog ' },
                { 'ID':. 1, 'Content': 'study notes'},
                { 'ID':. 4, 'Content': 'want to learn what to learn what' } 
            ] 
        }, 
        Methods: { 

            Remove (K) { 
                the console.log (K); 
            } 

        } 
    });

 </ Script> 
</ body> 
</ html>

 

Guess you like

Origin www.cnblogs.com/tommymarc/p/11641338.html