diff --git a/mock/role/index.ts b/mock/role/index.ts index 8bd18b3..07c274d 100644 --- a/mock/role/index.ts +++ b/mock/role/index.ts @@ -285,6 +285,14 @@ const adminList = [ meta: { title: 'router.inputPassword' } + }, + { + path: 'waterfall', + component: 'views/Components/Waterfall', + name: 'Waterfall', + meta: { + title: 'router.waterfall' + } } ] }, @@ -640,8 +648,8 @@ const testList: string[] = [ '/components/qrcode', '/components/highlight', '/components/infotip', - '/Components/InputPassword', - '/Components/Sticky', + '/components/input-password', + '/components/waterfall', 'function', '/function/multiple-tabs', '/function/multiple-tabs-demo/:id', diff --git a/mock/table/index.ts b/mock/table/index.ts index 0a79afd..cbe0541 100644 --- a/mock/table/index.ts +++ b/mock/table/index.ts @@ -46,8 +46,8 @@ for (let i = 0; i < count; i++) { content: baseContent, importance: '@integer(1, 3)', display_time: '@datetime', - pageviews: '@integer(300, 5000)', - image_uri: Mock.Random.image('@integer(300, 5000)x@integer(300, 5000)') + pageviews: '@integer(100, 500)', + image_uri: Mock.Random.image('@integer(100, 500)x@integer(100, 500)') }) ) } diff --git a/src/components/IconPicker/src/IconPicker.vue b/src/components/IconPicker/src/IconPicker.vue index 9e7ef21..0af1faa 100644 --- a/src/components/IconPicker/src/IconPicker.vue +++ b/src/components/IconPicker/src/IconPicker.vue @@ -15,17 +15,17 @@ const appStore = useAppStore() const size = computed(() => appStore.getCurrentSize) const iconSize = computed(() => { - return size.value === 'small' + return unref(size) === 'small' ? 'var(--el-component-size-small)' - : size.value === 'large' + : unref(size) === 'large' ? 'var(--el-component-size-large)' : 'var(--el-component-size)' }) const iconWrapStyle = computed((): CSSProperties => { return { - width: iconSize.value, - height: iconSize.value, + width: unref(iconSize), + height: unref(iconSize), display: 'flex', alignItems: 'center', justifyContent: 'center', @@ -45,7 +45,7 @@ const icons = [epIcons, antIcons, tIcons] const iconName = ref(icons[0].prefix) const currentIconNameIndex = computed(() => { - return icons.findIndex((item) => item.prefix === iconName.value) + return icons.findIndex((item) => item.prefix === unref(iconName)) }) const tabChange = () => { @@ -57,8 +57,8 @@ const pageSize = ref(63) const currentPage = ref(1) const filterIcons = (icons: string[]) => { - const start = (currentPage.value - 1) * pageSize.value - const end = currentPage.value * pageSize.value + const start = (unref(currentPage) - 1) * unref(pageSize) + const end = unref(currentPage) * unref(pageSize) return icons.slice(start, end) } @@ -81,7 +81,7 @@ async function init(icon?: string) { const index = icons[wrapIndex].icons.findIndex((item) => item === icon) // 计算当前icon的页码 await nextTick() - currentPage.value = Math.ceil((index + 1) / pageSize.value) + currentPage.value = Math.ceil((index + 1) / unref(pageSize)) } const popoverShow = () => { diff --git a/src/components/Waterfall/index.ts b/src/components/Waterfall/index.ts index 5815d1d..6fed67f 100644 --- a/src/components/Waterfall/index.ts +++ b/src/components/Waterfall/index.ts @@ -1,3 +1,3 @@ -import Waterfall from './Waterfall.vue' +import Waterfall from './src/Waterfall.vue' export { Waterfall } diff --git a/src/components/Waterfall/src/Waterfall.vue b/src/components/Waterfall/src/Waterfall.vue index b089e43..35a38bc 100644 --- a/src/components/Waterfall/src/Waterfall.vue +++ b/src/components/Waterfall/src/Waterfall.vue @@ -1,3 +1,20 @@ - + + + diff --git a/src/locales/en.ts b/src/locales/en.ts index 23da73f..bae870c 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -176,7 +176,8 @@ export default { multipleTabs: 'Multiple tabs', details: 'Details', iconPicker: 'Icon picker', - request: 'Request' + request: 'Request', + waterfall: 'Waterfall' }, permission: { hasPermission: 'Please set the operation permission value' diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 5c4f977..98068ec 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -174,7 +174,8 @@ export default { multipleTabs: '多开标签页', details: '详情页', iconPicker: '图标选择器', - request: '请求' + request: '请求', + waterfall: '瀑布流' }, permission: { hasPermission: '请设置操作权限值' diff --git a/src/router/index.ts b/src/router/index.ts index 0bb618f..a7f12d2 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -326,6 +326,14 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [ meta: { title: t('router.inputPassword') } + }, + { + path: 'waterfall', + component: () => import('@/views/Components/Waterfall.vue'), + name: 'waterfall', + meta: { + title: t('router.waterfall') + } } ] }, diff --git a/src/views/Components/Waterfall.vue b/src/views/Components/Waterfall.vue new file mode 100644 index 0000000..ac0a6b5 --- /dev/null +++ b/src/views/Components/Waterfall.vue @@ -0,0 +1,33 @@ + + +