Skip to content

Commit

Permalink
feat: support print page
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo committed Dec 30, 2023
1 parent d7b5abb commit 2ab6ae2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions theme/src/client/components/PageAside.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ function handleClick({ target: el }: Event) {
)
heading?.focus()
}
function handlePrint() {
window.print()
}
</script>

<template>
Expand All @@ -42,7 +46,7 @@ function handleClick({ target: el }: Event) {

<div class="outline-title">
<span>{{ theme.outlineLabel || 'On this page' }}</span>
<IconPrint class="icon" />
<IconPrint class="icon" @click="handlePrint" />
</div>

<nav aria-labelledby="doc-outline-aria-label">
Expand Down Expand Up @@ -89,7 +93,7 @@ function handleClick({ target: el }: Event) {
left: -1px;
z-index: 0;
opacity: 0;
width: 1px;
width: 2px;
height: 18px;
background-color: var(--vp-c-brand-1);
transition: top 0.25s cubic-bezier(0, 1, 0.5, 1), background-color 0.5s,
Expand All @@ -109,5 +113,6 @@ function handleClick({ target: el }: Event) {
width: 1em;
height: 1em;
font-size: 1.2em;
cursor: pointer;
}
</style>

0 comments on commit 2ab6ae2

Please sign in to comment.