hookehuyr

✨ feat(视频组件): 插槽功能测试

...@@ -25,8 +25,7 @@ ...@@ -25,8 +25,7 @@
25 </van-col> 25 </van-col>
26 </van-row> 26 </van-row>
27 </div> 27 </div>
28 - <div @click="goTo" style="color: #999999; padding: 0px 1rem 0.5rem;">{{ item.kg_name }} | {{ item.localism_type }} 28 + <slot name="bookDetailSub"></slot>
29 - </div>
30 </div> 29 </div>
31 <div class="audit-module"> 30 <div class="audit-module">
32 31
......
...@@ -64,7 +64,11 @@ ...@@ -64,7 +64,11 @@
64 <van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" 64 <van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''"
65 @load="onLoad"> 65 @load="onLoad">
66 <template v-for="item in prod_list" :key="item" style="height: 3rem;"> 66 <template v-for="item in prod_list" :key="item" style="height: 3rem;">
67 - <video-card :item="item"></video-card> 67 + <video-card :item="item">
68 + <template #bookDetailSub>
69 + <div @click="goToDetail(item.id, item.book_id, item.type)" style="color: #999999; padding: 0px 1rem 0.5rem;">{{ item.kg_name }} | {{ item.localism_type }} </div>
70 + </template>
71 + </video-card>
68 </template> 72 </template>
69 </van-list> 73 </van-list>
70 </div> 74 </div>
...@@ -241,7 +245,19 @@ const uploadVideo = () => { ...@@ -241,7 +245,19 @@ const uploadVideo = () => {
241 245
242 // TAG: keepAlive 缓存页面 246 // TAG: keepAlive 缓存页面
243 const store = mainStore(); 247 const store = mainStore();
244 -store.keepThisPage($route.meta.name); 248 +/**
249 + * 大菠萝的修改数据方式 3种
250 + */
251 +// 简单数据修改
252 +// store.keepPages.push($route.meta.name);
253 +// 多条数据修改
254 +store.$patch((state) => {
255 + state.keepPages = [...state.keepPages, $route.meta.name];
256 +})
257 +// 通过action修改
258 +// store.keepThisPage($route.meta.name);
259 +// 调用返回其他store的数据
260 +// store.getTestStoreList
245 261
246 onActivated(() => { // keepAlive 重置后执行回调 262 onActivated(() => { // keepAlive 重置后执行回调
247 // TAG: pinia应用,动态刷新数据 263 // TAG: pinia应用,动态刷新数据
...@@ -279,8 +295,20 @@ onBeforeRouteLeave(() => { ...@@ -279,8 +295,20 @@ onBeforeRouteLeave(() => {
279 store.changeScrollTop(window.scrollY) 295 store.changeScrollTop(window.scrollY)
280 }) 296 })
281 297
282 -/*********************************************************/ 298 +/*****************************************************/
283 299
300 +/****************** 视频组件相关操作 *******************/
301 +const goToDetail = (prod_id, book_id, type) => { // 跳转作品详情页
302 + $router.push({
303 + path: '/client/videoDetail',
304 + query: {
305 + prod_id,
306 + book_id,
307 + type // 特殊标识,判断入口 为keepAlive使用
308 + }
309 + });
310 +}
311 +/*****************************************************/
284 </script> 312 </script>
285 313
286 <script> 314 <script>
......