File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ export const lazyPlugin = {
99 mounted ( el , binding ) {
1010 //el:指令绑定元素
1111 //binding: bingding.value 指令等于号后面绑定的表达式的值 图片url
12- console . log ( el , binding . value )
12+ // console.log(el, binding.value)
1313 const targetIsVisible = shallowRef ( false )
1414 const { stop } = useIntersectionObserver (
1515 el ,
1616 ( [ entry ] , observerElement ) => {
1717 targetIsVisible . value = entry ?. isIntersecting || false
18- console . log ( targetIsVisible . value )
18+ // console.log(targetIsVisible.value)
1919 if ( targetIsVisible . value ) {
2020 el . src = binding . value
2121 stop ( )
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const router = createRouter({
1616 component : Home
1717 } ,
1818 {
19- path : 'category' ,
19+ path : 'category/:id ' ,
2020 component : Category
2121 }
2222 ]
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const categoryStore = useCategoryStore()
1717 <!-- 导航区域 -->
1818 <ul class =" app-header-nav" >
1919 <li class =" home" v-for =" item in categoryStore.categoryList" :key =" item.id" >
20- <RouterLink to =" / " >{{ item.name }}</RouterLink >
20+ <RouterLink : to =" `/category/${item.id}` " >{{ item.name }}</RouterLink >
2121 </li >
2222 </ul >
2323
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const categoryStore = useCategoryStore()
1515 </h1 >
1616 <ul class =" app-header-nav" >
1717 <li class =" home" v-for =" item in categoryStore.categoryList" :key =" item.id" >
18- <RouterLink to =" / " >{{ item.name }}</RouterLink >
18+ <RouterLink : to =" `/category/${item.id}` " >{{ item.name }}</RouterLink >
1919 </li >
2020
2121 </ul >
You can’t perform that action at this time.
0 commit comments