Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
319935f
commit 41d34ca
Showing
7 changed files
with
149 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<div> | ||
<button class="swap-layout" @click="swapLayout"> | ||
swap layout | ||
</button> | ||
<button class="log-foo" @click="logFoo"> | ||
log foo | ||
</button> | ||
<button class="log-hello" @click="logHello"> | ||
log hello | ||
</button> | ||
<NuxtLayout ref="layout" /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const layout = ref() | ||
const currentLayout = useState('current-layout', () => 'custom') | ||
definePageMeta({ | ||
layout: 'custom' | ||
}) | ||
function logFoo () { | ||
layout.value.layoutRef.logFoo() | ||
} | ||
function logHello () { | ||
layout.value.layoutRef.logHello() | ||
} | ||
function swapLayout () { | ||
currentLayout.value = currentLayout.value === 'custom2' ? 'custom' : 'custom2' | ||
setPageLayout(currentLayout.value) | ||
} | ||
</script> |