lex 1 سال پیش
والد
کامیت
3e051385d6

+ 4 - 2
src/views/content-information/content-instrument/index.tsx

@@ -5,7 +5,7 @@ import {
   NTabPane,
   NTabs
 } from 'naive-ui';
-import { defineComponent, reactive } from 'vue';
+import { defineComponent, nextTick, reactive } from 'vue';
 import styles from './index.module.less';
 import icon_back from '../../xiaoku-music/images/icon_back.png';
 // import icon_separator from '../../xiaoku-music/images/icon_separator.png';
@@ -33,7 +33,9 @@ export default defineComponent({
 
         state.categoryList = data.rows || [];
         if (state.categoryList.length) {
-          state.tabValue = tabValue || 'name-' + state.categoryList[0].id;
+          nextTick(() => {
+            state.tabValue = tabValue || 'name-' + state.categoryList[0].id;
+          });
         }
       } catch {
         //

+ 5 - 2
src/views/content-information/content-music/index.tsx

@@ -5,7 +5,7 @@ import {
   NTabPane,
   NTabs
 } from 'naive-ui';
-import { defineComponent, reactive } from 'vue';
+import { defineComponent, nextTick, reactive } from 'vue';
 import styles from './index.module.less';
 import icon_back from '../../xiaoku-music/images/icon_back.png';
 import { useRouter } from 'vue-router';
@@ -33,7 +33,9 @@ export default defineComponent({
 
         state.categoryList = data.rows || [];
         if (state.categoryList.length) {
-          state.tabValue = tabValue || 'name-' + state.categoryList[0].id;
+          nextTick(() => {
+            state.tabValue = tabValue || 'name-' + state.categoryList[0].id;
+          });
         }
       } catch {
         //
@@ -64,6 +66,7 @@ export default defineComponent({
               paneWrapperClass={styles.paneWrapperContainer}
               v-model:value={state.tabValue}
               onUpdate:value={(val: any) => {
+                console.log(val, 'val');
                 sessionStorage.setItem('content-music-tab', val);
               }}>
               {state.categoryList.map((category: any) => (

+ 4 - 2
src/views/content-information/content-musician/index.tsx

@@ -5,7 +5,7 @@ import {
   NTabPane,
   NTabs
 } from 'naive-ui';
-import { defineComponent, reactive } from 'vue';
+import { defineComponent, nextTick, reactive } from 'vue';
 import styles from './index.module.less';
 import icon_back from '../../xiaoku-music/images/icon_back.png';
 // import icon_separator from '../../xiaoku-music/images/icon_separator.png';
@@ -33,7 +33,9 @@ export default defineComponent({
 
         state.categoryList = data.rows || [];
         if (state.categoryList.length) {
-          state.tabValue = tabValue || 'name-' + state.categoryList[0].id;
+          nextTick(() => {
+            state.tabValue = tabValue || 'name-' + state.categoryList[0].id;
+          });
         }
       } catch {
         //