VueJS笔记基础篇

<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js">script>

$ cnpm install vue


<html>
    <head>
        <meta charset="utf-8" />
        <title>vuejstitle>
        <script type="text/javascript" src="js/vue.js" >script>
    head>
    <body>
        <div id="demo">
            <span v-on:click='clickHandle'>{{message}}span>
        div>

        <script>
            let data={
                message:'hello,vuejs'
            }

            var vm = new Vue({
                el:'#demo',
                data:data,
                methods:{
                    clickHandle:function(){
                        alert(1);
                    }
                }
            })
        script>
    body>
html>

<a v-bind:href="url">a>

<a :href="url">a>


<a v-on:click="doSomething">a>

<a @click="doSomething">a>

`

v-else-if    v-if   v-for

你可能感兴趣的:(vuejs)