2019-04-24

html

  1. HTML <!DOCTYPE> 標(biāo)簽

css

  1. flex

vue

  1. vm.$emit用法
vm.$emit(event, arg )
  • $emit 綁定一個(gè)自定義事件event,當(dāng)這個(gè)這個(gè)語句被執(zhí)行到的時(shí)候,就會(huì)將參數(shù)arg傳遞給父組件,父組件通過@event監(jiān)聽并接收參數(shù)。
<template>
 <div>
  <h1>{{title}}</h1>
  <child @getMessage="showMsg"></child>
 </div>
</template>
 
<script>
 import Child from '../components/child.vue'
 export default {
  components: {Child},
  data(){
     return{title:''}
  },
  methods:{
   showMsg(title){this.title=title;}
     }
 }
</script>
<template>
 <h3>我是子組件!</h3>
</template>
<script>
 export default {
  mounted: function () {
   this.$emit('getMessage', '我是父組件!')
  }
 }
</script>
  1. watch
  2. props
  • 默認(rèn)值設(shè)置
  • props down, events up
    父組件通過 props 向下傳遞數(shù)據(jù)給子組件;子組件通過 events 給父組件發(fā)送消息。

javascript

  1. avaScript unshift() 方法

scrolltolower事件

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容