This commit is contained in:
dap
2024-08-27 08:14:19 +08:00
72 changed files with 374 additions and 138 deletions

View File

@@ -28,7 +28,7 @@
#app,
body,
html {
@apply size-full overscroll-none;
@apply !pointer-events-auto size-full overscroll-none;
}
body {

View File

@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { getElementVisibleRect } from '../dom'; // 假设函数位于 utils.ts 中
import { getElementVisibleRect } from '../dom';
describe('getElementVisibleRect', () => {
// 设置浏览器视口尺寸的 mock

View File

@@ -7,7 +7,6 @@ import {
toLowerCaseFirstLetter,
} from '../letter';
// 编写测试用例
describe('capitalizeFirstLetter', () => {
it('should capitalize the first letter of a string', () => {
expect(capitalizeFirstLetter('hello')).toBe('Hello');

View File

@@ -13,8 +13,7 @@ describe('uniqueByField', () => {
const uniqueItems = uniqueByField(items, 'id');
// Assert expected results
expect(uniqueItems).toHaveLength(3); // After deduplication, there should be three objects left
expect(uniqueItems).toHaveLength(3);
expect(uniqueItems).toEqual([
{ id: 1, name: 'Item 1' },
{ id: 2, name: 'Item 2' },

View File

@@ -11,8 +11,9 @@ type ThemeModeType = 'auto' | 'dark' | 'light';
* 偏好设置按钮位置
* fixed 固定在右侧
* header 顶栏
* auto 自动
*/
type PreferencesButtonPositionType = 'fixed' | 'header';
type PreferencesButtonPositionType = 'auto' | 'fixed' | 'header';
type BuiltinThemeType =
| 'custom'