{widgetList.map((el) => (
diff --git a/src/layout/grid/BlockSettings.tsx b/src/layout/grid/BlockSettings.tsx
index a8a05cd..f5fe4dc 100644
--- a/src/layout/grid/BlockSettings.tsx
+++ b/src/layout/grid/BlockSettings.tsx
@@ -8,52 +8,20 @@ export default defineComponent(() => {
return () => (
图标大小
+ label: () => 图标显示名称
}}
>
-
+
图标间距
+ label: () => 是否在桌面上显示添加图标
}}
>
-
+
区域宽度
- }}
- >
-
-
-
图标圆角
}}
@@ -67,22 +35,48 @@ export default defineComponent(() => {
/>
{' '}
图标区域宽度
+ }}
+ >
+
+
+ {/*
图标大小
+ }}
+ >
+
+ */}
+ {/*
添加图标
+ label: () => 图标间距
}}
>
-
-
-
显示标签
- }}
- >
-
-
+
+ */}
)
})
diff --git a/src/settings/SettingItem.tsx b/src/settings/SettingItem.tsx
index 6a067df..c1a4026 100644
--- a/src/settings/SettingItem.tsx
+++ b/src/settings/SettingItem.tsx
@@ -24,7 +24,7 @@ export default defineComponent({
setup(props, ctx) {
return () => (
{ctx.slots.label?.()}
-
{ctx.slots.default?.()}
- {ctx.slots.end?.()}
+
{ctx.slots.default?.()}
+ {/* {ctx.slots.end?.()} */}
)
}
diff --git a/src/utils/CategoryTab.tsx b/src/utils/CategoryTab.tsx
index 9317599..b077cc5 100644
--- a/src/utils/CategoryTab.tsx
+++ b/src/utils/CategoryTab.tsx
@@ -1,94 +1,113 @@
-import type { BackgroundType } from "@/layout/background/BackgroundSwtich";
-import clsx from "clsx";
-import gsap from "gsap";
-import { defineComponent, reactive, ref, watch, type SlotsType, type VNode } from "vue";
-
+import type { BackgroundType } from '@/layout/background/BackgroundSwtich'
+import clsx from 'clsx'
+import gsap from 'gsap'
+import { defineComponent, reactive, ref, watch, type SlotsType, type VNode } from 'vue'
+/**
+ * @description 背景切换组件
+ * @props props:list 背景列表
+ * @props selectType 选中的类型
+ * @slots select 选中的元素
+ * @slots unSelect 未选中的元素
+ * @emits update:type 选中的类型
+ */
export default defineComponent({
- props: {
- list: {
- type: Array
,
- required: true
- },
- selectType: {
- type: String,
- required: true,
- },
-
+ props: {
+ list: {
+ type: Array,
+ required: true
},
- slots: {} as SlotsType<{
- select?: (text: string) => VNode[]
- unSelect?: (text: string) => VNode[]
- }>,
- emits: ['update:type'],
- setup(props, ctx) {
- const tabRefs = ref<(Element | null)[]>([])
- const parentRef = ref(null)
- const number = ref(0)
- const tweened = reactive({
- number: 0
- })
+ selectType: {
+ type: String,
+ required: true
+ }
+ },
+ slots: {} as SlotsType<{
+ select?: (text: string) => VNode[]
+ unSelect?: (text: string) => VNode[]
+ }>,
+ emits: ['update:type'],
+ setup(props, ctx) {
+ const tabRefs = ref<(any | null)[]>([])
+ const parentRef = ref(null)
+ const number = ref(0)
+ const tweened = reactive({
+ number: 0
+ })
+ watch(number, (n, old) => {
+ console.log(Math.abs(n - old) / 400)
- watch(number, (n) => {
- gsap.to(tweened, {
- number: n,
- duration: .5,
- onUpdate: () => {
- if (parentRef.value)
- parentRef.value.scrollLeft = tweened.number
- },
- });
- })
-
- watch(() => [props.selectType], () => {
- const idx = props.list.findIndex((item) => item.id === props.selectType)
- if (idx === -1) return
- if (tabRefs.value[idx]) {
- const childRef = tabRefs.value[idx]
- if (!childRef) return
- if (!childRef.parentElement) return
- const parentRect = childRef.parentElement.getBoundingClientRect()
- const childRect = childRef.getBoundingClientRect()
- const distance = childRect.left - parentRect.left
- if (!parentRef.value) return
- if (idx > 3) {
- number.value = distance - 350
- } else {
- number.value = 0
-
- }
- } else {
- number.value = 0
-
- }
+ gsap.to(tweened, {
+ number: n,
+ duration: Math.abs(n - old) / 400 < 0.5 ? 0.5 : Math.abs(n - old) / 400,
+ onUpdate: () => {
+ if (parentRef.value) parentRef.value.scrollLeft = tweened.number
}
- )
- return () => (
-
-
- )
- },
-})
\ No newline at end of file
+ if (tabRefs.value[idx]) {
+ const childRef = tabRefs.value[idx]
+
+ if (!childRef) return
+ if (!childRef.parentElement) return
+ const parentRect = childRef.parentElement.getBoundingClientRect()
+ const childRect = childRef.getBoundingClientRect()
+ const distance = childRect.left - parentRect.left
+ if (!parentRef.value) return
+ if (idx > 3) {
+ number.value = distance - 280
+ } else {
+ number.value = 0
+ }
+ } else {
+ number.value = 0
+ }
+ }
+ )
+ return () => (
+
+ )
+ }
+})
diff --git a/src/widgets/gameVideo/Large.tsx b/src/widgets/gameVideo/Large.tsx
index cccbd51..6d316b9 100644
--- a/src/widgets/gameVideo/Large.tsx
+++ b/src/widgets/gameVideo/Large.tsx
@@ -38,10 +38,10 @@ export default defineComponent(() => {
watch(
() => useLayoutStore().state.current,
(val) => {
- const type = val === 0 ? 'game' : val === 1 ? 'study' : 'entertainment'
+ const type = val === 0 ? 'game' : val === 1 ? 'know' : 'ent'
request