|
@@ -1,5 +1,5 @@
|
|
|
import { NTabPane, NTabs } from 'naive-ui';
|
|
|
-import { defineComponent, onMounted, ref, toRefs } from 'vue';
|
|
|
+import { defineComponent, nextTick, onMounted, ref, toRefs } from 'vue';
|
|
|
import styles from './index.module.less';
|
|
|
import SelectItem from './select-item';
|
|
|
import { useResizeObserver } from '@vueuse/core';
|
|
@@ -25,20 +25,22 @@ export default defineComponent({
|
|
|
const catchStore = useCatchStore();
|
|
|
|
|
|
onMounted(async () => {
|
|
|
- useResizeObserver(
|
|
|
- document.querySelector(
|
|
|
- '.select-resource .n-tabs-nav--top'
|
|
|
- ) as HTMLElement,
|
|
|
- (entries: any) => {
|
|
|
- const entry = entries[0];
|
|
|
- const { height } = entry.contentRect;
|
|
|
- console.log(height, 'height - 11');
|
|
|
- document.documentElement.style.setProperty(
|
|
|
- '--modal-lesson-tab-height',
|
|
|
- height + 'px'
|
|
|
- );
|
|
|
- }
|
|
|
- );
|
|
|
+ nextTick(() => {
|
|
|
+ useResizeObserver(
|
|
|
+ document.querySelector(
|
|
|
+ '.select-resource .n-tabs-nav--top'
|
|
|
+ ) as HTMLElement,
|
|
|
+ (entries: any) => {
|
|
|
+ const entry = entries[0];
|
|
|
+ const { height } = entry.contentRect;
|
|
|
+ console.log(height, 'height - 11');
|
|
|
+ document.documentElement.style.setProperty(
|
|
|
+ '--modal-lesson-tab-height',
|
|
|
+ height + 'px'
|
|
|
+ );
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
// 获取教材分类列表
|
|
|
await catchStore.getMusicSheetCategory(true);
|
|
|
});
|