|
@@ -16,6 +16,7 @@ import OSticky from '@/components/o-sticky';
|
|
|
import OEmpty from '@/components/o-empty';
|
|
|
import CourseItem from '../lessonCourseware/component/CourseItem';
|
|
|
import OLoading from '@/components/o-loading';
|
|
|
+import { useEventListener } from '@vant/use';
|
|
|
export default defineComponent({
|
|
|
name: 'courseList',
|
|
|
setup() {
|
|
@@ -37,7 +38,8 @@ export default defineComponent({
|
|
|
actionKey: 0,
|
|
|
loading: true,
|
|
|
subjectList: [] as any,
|
|
|
- classList: [] as any
|
|
|
+ classList: [] as any,
|
|
|
+ titleOpacity: 0
|
|
|
});
|
|
|
|
|
|
const FetchList = async () => {
|
|
@@ -146,6 +148,14 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ useEventListener('scroll', () => {
|
|
|
+ const height =
|
|
|
+ window.scrollY ||
|
|
|
+ window.pageYOffset ||
|
|
|
+ document.documentElement.scrollTop;
|
|
|
+ state.titleOpacity = height > 100 ? 1 : height / 100;
|
|
|
+ });
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
//
|
|
|
if (state.topKey === 'music') {
|