第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
  • computed:計算屬性

    watch:偵聽器


    查看全部
  • 父組件向子組件傳遞值:通過屬性

    子組件向父組件傳遞:通過發(fā)布訂閱模式,子組件發(fā)布函數(shù)父組件訂閱

    $emit()向外觸發(fā)一個自定義delete事件,攜帶了index的值



    push() 方法可向數(shù)組的末尾添加一個或多個元素,并返回新的長度。

    <body>

    <div id="root">

    <div>

    <input v-model="inputValue"/>

    <button @click="handleSubmit">提交</button>

    </div>

    <ul>

    <todo-item v-for="(item,index) of list"

    :key="index"

    :content="item"http://向組件傳遞屬性

    :index="index"

    @delete="handleDelete"

    ></todo-item>

    </ul>

    </div>

    <script type="text/javascript">


    Vue.component('todo-item',{

    props:['content','index'],//接收從外部傳進(jìn)來的屬性content

    template:'<li @click="handleClick">{{content}}</li>',

    methods:{

    handleClick:function(){

    this.$emit('delete',this.index)

    }

    }

    })


    new Vue({

    el:"#root",

    data:{

    inputValue:"",

    list:[]

    },

    methods:{

    handleSubmit:function(){

    this.list.push(this.inputValue)

    this.inputValue=''

    },

    handleDelete:function(index){

    //alert(index)

    this.list.splice(index,1)

    }

    }

    })


    </script>

    </body>


    查看全部
  • 這個課程的代碼我已經(jīng)打包在 https://github.com/1171843306/Vue.js
    大家可以去那里下載或者觀看

    查看全部
  • 這個課程的代碼我已經(jīng)打包在 https://github.com/1171843306/Vue.js
    大家可以去那里下載或者觀看

    查看全部
    2 采集 收起 來源:課程介紹

    2018-06-19

  • 這個課程的代碼我已經(jīng)打包在 https://github.com/1171843306/Vue.js
    大家可以去那里下載或者觀看

    查看全部
    4 采集 收起 來源:課程總結(jié)

    2018-06-19

  • vue.js 引入在html的head部分,防止頁面加載收出現(xiàn)抖動

    查看全部
  • vue.js
    查看全部
    0 采集 收起 來源:課程介紹

    2018-06-19

  • computed:計算屬性

    watch:偵聽器


    查看全部
  • 屬性綁定:v-bind: 通常簡寫為 :?

    雙向數(shù)據(jù)綁定:v-model?

    tips: new Vue({ }) 不能寫成 new Vue ({ })中間不能有空格符號,不然數(shù)據(jù)渲染無效

    查看全部
  • 數(shù)據(jù)綁定,{{}} 屬性綁定,v-bind:/: 雙向綁定,v-model 事件綁定,v-on:/@
    查看全部
  • {{}} 表示為插值表達(dá)式,將要顯示的內(nèi)容插入需要顯示的地方,進(jìn)行顯示不進(jìn)行任何操作

    v-text? 與? v-html? ?區(qū)別在于v-text會將輸出的內(nèi)容進(jìn)行轉(zhuǎn)義然后再進(jìn)行輸出,而v-html不會進(jìn)行轉(zhuǎn)義而是直接輸出

    v-on:clck? 代表點(diǎn)擊事件? click="",雙引號中代表點(diǎn)擊后調(diào)用的函數(shù)

    函數(shù)綁定在Vue實(shí)例下的methods下,定義需要調(diào)用的方法

    ? 當(dāng)數(shù)據(jù)發(fā)生變化時,Vue會自動幫你更新DOM?

    不在面相DOM編程,而是面相數(shù)據(jù)進(jìn)行編程

    v-on: 可以簡寫為@符號 即為v-on:click簡寫為@click

    查看全部
  • 每一個組件都是一個實(shí)例,如果一個Vue的實(shí)例沒有模板template,它就會找到它的掛載點(diǎn),把掛載點(diǎn)里的DOM標(biāo)簽當(dāng)做Vue的實(shí)例模板

    查看全部
  • <body>

    <div id="root">

    <div>

    <input v-model="inputValue"/>

    <button @click="handelSubmit">提交</button>

    </div>

    <ul>

    <todo-item v-for="(item,index) of list"

    :key="index"

    :content="item"http://向組件傳遞屬性

    ></todo-item>

    </ul>

    </div>

    <script type="text/javascript">


    Vue.component('todo-item',{

    props:['content'],//接收從外部傳進(jìn)來的屬性content

    template:'<li>{{content}}</li>'

    })


    new Vue({

    el:"#root",

    data:{

    inputValue:"",

    list:[]

    },

    methods:{

    handelSubmit:function(){

    this.list.push(this.inputValue)

    this.inputValue=''

    }

    }

    })


    </script>

    </body>


    查看全部
  • <body>

    <div id="root">

    <div>

    <input v-model="inputValue"/>

    <button @click="handelSubmit">提交</button>

    </div>

    <ul v-for="(item,index) of list" :key="index">

    <li>{{item}}</li>

    </ul>

    </div>

    <script type="text/javascript">

    new Vue({

    el:"#root",

    data:{

    inputValue:"",

    list:[]

    },

    methods:{

    handelSubmit:function(){

    this.list.push(this.inputValue)

    this.inputValue=''

    }

    }

    })


    </script>

    </body>


    查看全部
  • :value->是單向綁定數(shù)據(jù),v-model->是雙向數(shù)據(jù)綁定。https://img1.sycdn.imooc.com//5b20ea350001a25c09000695.jpg

    查看全部

舉報

0/150
提交
取消
課程須知
1、對Javascript基礎(chǔ)知識已經(jīng)掌握。 2、對Es6和webpack有簡單了解。
老師告訴你能學(xué)到什么?
使用Vue2.0版本實(shí)現(xiàn)響應(yīng)式編程 2、理解Vue編程理念與直接操作Dom的差異 3、Vue常用的基礎(chǔ)語法 4、使用Vue編寫TodoList功能 5、什么是Vue的組件和實(shí)例 6、Vue-cli腳手架工具的使用 7、但文件組件,全局樣式與局部樣式

微信掃碼,參與3人拼團(tuán)

微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復(fù)購買,感謝您對慕課網(wǎng)的支持!