# 🏅 6/24 (四) 每日任務 Day 44 ###### tags: `Vue 直播班 - 2021 夏季班` 題目 (請將答案貼上 CodePen) --- 操作 [這個模板](https://codepen.io/rider159159/pen/ExWORqq),執行以下要求 (只能操作 JS 的部分): > provide 跨層級通訊 > - 使用 provide 方法,將 cash (1000) 傳送給 ming 元件,但不要讓 ming-mom 元件收到,cash 的值。 > - 提示一: app 為第一層、ming-mom 為第二層、ming 為第三層。 > - 提示二: 請勿使用 props 、 mitt 方法 > - 實際狀況如圖: > ![](https://i.imgur.com/yxavr9V.png) 參考:https://courses.hexschool.com/courses/vue-2021/lectures/31863562 回報流程 --- 請同學依照下圖教學觀看解答、回報答案: ![](https://i.imgur.com/QtL8zEW.png) 回報格式如下圖,請在「回報區」使用註解回報答案 (為了統計人數,請同學依序加上「報數」) ![](https://i.imgur.com/L7kyew8.png) <!-- 解答 const ming = { template: `<div> 小明拿到了 {{ this.cash }} 為零用錢 </div>`, inject:['cash'], } const app = Vue.createApp({ data() { return { cash:1000, } }, provide(){ return{ cash:this.cash, } }, }) --> 回報區 --- <!--Alpha Codepen:https://codepen.io/alphatero/pen/BaWgGdg --> <!-- 2. Alysa Chan codepen: https://codepen.io/alysachan/pen/xxqoQpp --> <!-- 3. Lina Chen codepen: https://codepen.io/LinaChen/pen/zYZVMpd --> <!-- 4: 陳sam codepen: https://codepen.io/euldpliv/pen/yLMdQva?editors=1011 --> <!-- 5: Vic codepen: https://codepen.io/hsuan333/pen/mdWZQQY --> <!-- 6: peter.chen1024 codepen: https://codepen.io/JIAN-RONG/pen/Rwpzqvm?editors=1010 --> <!-- 7: RitaHuang https://codepen.io/Rita-Rossweisse/pen/ZEedmVy --> <!-- 8: youting codepen: https://codepen.io/youtingluo/pen/BaWgvpL?editors=1011 --> <!--9: yijun codepen: https://codepen.io/sandy3068/pen/eYvwbXb --> <!--10: Wendy Li codepen: https://codepen.io/rockayumitw/pen/JjWQwgj --> <!-- 11: Yi Chieh Codepen: https://codepen.io/Yi-Chieh/pen/yLMdZGB --> <!-- 12: Joe Kuo Codepen: https://codepen.io/alertislow/pen/vYxqbVW --> <!-- 13: leolee Codepen: https://codepen.io/nekorice/pen/RwpzOQW --> <!-- 14: Jay codepen: https://codepen.io/jayredk/pen/wvJVWRv --> <!-- 15: Erica https://codepen.io/ericadu/pen/oNZKoEq --> <!-- 16: YOYO codepen: https://codepen.io/lumedkle/pen/yLbByrv --> <!-- 17: Larry codepen: https://codepen.io/manpower0708/pen/LYyPNdG --> <!-- 18: Echo codepen: https://codepen.io/echohuiecho/pen/KKmPGzZ?editors=1111 --> <!-- 19: jimmyFang codepen: https://codepen.io/pohxiqqo/pen/PomwYKN?editors=1010 --> <!-- 20: Chiang codepen: https://codepen.io/ChiangJ/pen/jOmEjze?editors=1010 --> <!-- 20: Oober codepen: https://codepen.io/xtsjrjdv/pen/JjNdagO --> <!-- 21: twoz codepen: https://codepen.io/twoz/pen/GRmZppa?editors=1010 --> <!--22: Stacey Huang codepen: https://codepen.io/staceyhuang/pen/BaRWoMq -->