国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

個人網(wǎng)站建設(shè)方案書 范文百度免費推廣網(wǎng)站

個人網(wǎng)站建設(shè)方案書 范文,百度免費推廣網(wǎng)站,用凡科做網(wǎng)站好弄嗎,臨海市建設(shè)局官網(wǎng)站vue小案例 組件化編碼流程 1.拆分靜態(tài)組件,按功能點拆分 2.實現(xiàn)動態(tài)組件 3.實現(xiàn)交互 文章目錄vue小案例組件化編碼流程1.父組件給子組件傳值2.通過APP組件給子組件傳值。3.案例實現(xiàn)4.項目小細(xì)節(jié)1.父組件給子組件傳值 父組件給子組件傳值 1.在父組件中寫好要傳的值&a…

vue小案例

組件化編碼流程

1.拆分靜態(tài)組件,按功能點拆分
2.實現(xiàn)動態(tài)組件
3.實現(xiàn)交互

在這里插入圖片描述

文章目錄

      • vue小案例
      • 組件化編碼流程
          • 1.父組件給子組件傳值
          • 2.通過APP組件給子組件傳值。
          • 3.案例實現(xiàn)
          • 4.項目小細(xì)節(jié)

1.父組件給子組件傳值

父組件給子組件傳值
1.在父組件中寫好要傳的值,在子組件中接受

傳值

 <List :todoList="todoList"></List>

接受

props:['todoList']
2.通過APP組件給子組件傳值。

1.在app的methods方法中添加一個方法receive用于接受子組件傳遞的值。
2.在子組件中通過props接受app組件傳遞的方法receive。
3.調(diào)用receive方法傳遞子組件想要傳遞的值。
4.在app父組件中接受子組件傳遞的值。

在app的methods方法中添加一個方法receive用于接受子組件傳遞的值

methods:{receive(res){this.todoList.unshift(res)}}

在子組件中通過props接受app組件傳遞的方法receive

 props:['receive'],
//傳值this.receive(addObj)

在app父組件中接受子組件傳遞的值。

 receive(res){this.todoList.unshift(res)}

在這里插入圖片描述

3.案例實現(xiàn)
<template> <div><div class="content"><Header :receive="receive"></Header><List :todoList="todoList" :handcheck="handcheck" :deleteHand="deleteHand"></List><Footer :todoList="todoList" :isALL="isALL"></Footer></div></div>
</template><script>
import Footer from './components/Footer.vue'
import List from './components/List.vue'
import Header from './components/Header.vue'
export default {name:'App',data(){return{todoList:[{id:'001',title:"睡覺",done:true},{id:'002',title:"學(xué)習(xí)",done:true},{id:'003',title:"喝酒",done:false},]}},components:{Footer,Header,List},methods:{// 添加receive(res){this.todoList.unshift(res)},// =改變handcheck(id){console.log(id)this.todoList.forEach((todo)=>{if(todo.id===id)todo.done=!todo.done})},deleteHand(id){this.todoList=this.todoList.filter((todo)=>{return todo.id!==id})},isALL(done){this.todoList.forEach((todo)=>{todo.done=done})}}
}
</script><style >.content{width: 500rpx;height: 500rpx;border-radius: 20rpx;border: 5rpx solid black;}
</style>
<template><div><Item v-for="item in todoList" :key="item.id" :todo="item" :handcheck="handcheck" :deleteHand="deleteHand"></Item></div>
</template><script>
import Item from './Item.vue'
export default {name:"List",components:{Item},props:['todoList','handcheck','deleteHand'],
}
</script><style></style>

在這里插入圖片描述

4.項目小細(xì)節(jié)

nanoid (生成唯一id)
1.下載naoid npm i nanoid,
2.使用nanoid 在項目中 import {nanoid} from ‘nanoid’,
3.使用 id:nanoid
在這里插入圖片描述

http://aloenet.com.cn/news/31073.html

相關(guān)文章:

  • 做娛樂新聞的網(wǎng)站有哪些市場調(diào)研報告范文
  • wp怎么做雙語網(wǎng)站百度快速收錄入口
  • 網(wǎng)站空間支持什么程序邯鄲百度推廣公司
  • mvc5 web網(wǎng)站開發(fā)實戰(zhàn)廣州百度seo優(yōu)化排名
  • 貴金屬網(wǎng)站模板網(wǎng)站收錄提交入口網(wǎng)址
  • dw如何用表格做網(wǎng)站免費網(wǎng)頁制作平臺
  • 代理服務(wù)器地址怎么找搜狗排名優(yōu)化工具
  • b2c商城網(wǎng)站建設(shè)目的網(wǎng)頁關(guān)鍵詞優(yōu)化軟件
  • 網(wǎng)站開發(fā) 群百度公司的企業(yè)文化
  • 做網(wǎng)站借用網(wǎng)絡(luò)圖片不違法吧北京seo的排名優(yōu)化
  • 網(wǎng)站開發(fā)工作室中國站長之家官網(wǎng)
  • 慈溪哪點有學(xué)做網(wǎng)站的外鏈官網(wǎng)
  • 深圳市住房和建設(shè)局紅色警示青島seo精靈
  • 廣西慶海建設(shè)發(fā)展有限公司網(wǎng)站網(wǎng)絡(luò)營銷計劃包括哪七個步驟
  • 網(wǎng)頁制作語言seo優(yōu)化包括哪些內(nèi)容
  • 小程序代理多少錢新余seo
  • 外貿(mào)怎么上國外的網(wǎng)站百度搜索引擎排行榜
  • 分類信息網(wǎng)站有哪些關(guān)鍵詞優(yōu)化案例
  • wordpress主題一鍵生成云南網(wǎng)站建設(shè)快速優(yōu)化
  • 建設(shè)商業(yè)門戶網(wǎng)站的重要適合獎勵自己的網(wǎng)站免費
  • 劍網(wǎng)三魁首怎么做網(wǎng)站在線建站平臺
  • wordpress手機中文版seo優(yōu)化是什么職業(yè)
  • 濟南網(wǎng)站制作價格吸引顧客的營銷策略
  • 源碼開發(fā)網(wǎng)站建設(shè)市場營銷四大分析方法
  • 網(wǎng)站水印怎么做的推廣網(wǎng)頁
  • 帶dede后臺的整套網(wǎng)站源碼怎么本地測試安裝上海短視頻培訓(xùn)機構(gòu)
  • 小說網(wǎng)站建設(shè)箋池齋上海百度推廣官方電話
  • 啤酒免費代理0元鋪貨優(yōu)化軟件有哪些
  • 網(wǎng)站策劃包括什么國內(nèi)免費b2b網(wǎng)站大全
  • 網(wǎng)站建設(shè)死人接單關(guān)鍵詞查找工具