Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-23 12:53:40 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9b58bf79058b80803316f2bdf553dc8d045eeb7d
9b58bf79
1 parent
3218f098
✨ feat(视频组件): 插槽功能测试
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
5 deletions
src/components/VideoCard/index.vue
src/views/client/bookDetail.vue
src/components/VideoCard/index.vue
View file @
9b58bf7
...
...
@@ -25,8 +25,7 @@
</van-col>
</van-row>
</div>
<div @click="goTo" style="color: #999999; padding: 0px 1rem 0.5rem;">{{ item.kg_name }} | {{ item.localism_type }}
</div>
<slot name="bookDetailSub"></slot>
</div>
<div class="audit-module">
...
...
src/views/client/bookDetail.vue
View file @
9b58bf7
...
...
@@ -64,7 +64,11 @@
<van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''"
@load="onLoad">
<template v-for="item in prod_list" :key="item" style="height: 3rem;">
<video-card :item="item"></video-card>
<video-card :item="item">
<template #bookDetailSub>
<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>
</template>
</video-card>
</template>
</van-list>
</div>
...
...
@@ -241,7 +245,19 @@ const uploadVideo = () => {
// TAG: keepAlive 缓存页面
const store = mainStore();
store.keepThisPage($route.meta.name);
/**
* 大菠萝的修改数据方式 3种
*/
// 简单数据修改
// store.keepPages.push($route.meta.name);
// 多条数据修改
store.$patch((state) => {
state.keepPages = [...state.keepPages, $route.meta.name];
})
// 通过action修改
// store.keepThisPage($route.meta.name);
// 调用返回其他store的数据
// store.getTestStoreList
onActivated(() => { // keepAlive 重置后执行回调
// TAG: pinia应用,动态刷新数据
...
...
@@ -279,8 +295,20 @@ onBeforeRouteLeave(() => {
store.changeScrollTop(window.scrollY)
})
/*****************************************************
****
/
/*****************************************************/
/****************** 视频组件相关操作 *******************/
const goToDetail = (prod_id, book_id, type) => { // 跳转作品详情页
$router.push({
path: '/client/videoDetail',
query: {
prod_id,
book_id,
type // 特殊标识,判断入口 为keepAlive使用
}
});
}
/*****************************************************/
</script>
<script>
...
...
Please
register
or
login
to post a comment