Skip to content

Commit

Permalink
[snippets] 完善方法 toggleThemeViewTransition 文档注释
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang-Wei-666 committed Aug 5, 2024
1 parent b8a7e84 commit bea2a0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/snippets/src/toggleThemeViewTransition/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@ import { nextTick, toValue } from 'vue-demi';
import styleText from './index.scss?inline';

interface ToggleThemeViewTransitionOptions {
/** X 轴坐标 ( 传递鼠标事件的 clientX ) */
x?: number;
/** Y 轴坐标 ( 传递鼠标事件的 clientY ) */
y?: number;
/** 是否反转动画 */
reverse?: Ref<boolean> | (() => boolean);
}

/**
* 切换主题时的视图过渡动画
*
* @see https://vitepress.dev/guide/extending-default-theme#using-view-transitions-api
* @param toggle 切换主题的方法
* @param options 可选项
*/
export async function toggleThemeViewTransition(
toggle: () => void,
options: ToggleThemeViewTransitionOptions = {},
Expand Down

0 comments on commit bea2a0b

Please sign in to comment.