Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add teleportRootEl config #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion playground/src/pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
* @Date: 2023-07-18
* @Any: any comment
-->

<script setup lang="ts">
import { ref } from "vue";
const title = ref<string>("Hello");
const popShow = ref<boolean>(true);
function handleChange() {
popShow.value = !popShow.value;
}
Comment on lines +8 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the function handleChange and variable popShow are adequately commented to explain their purpose in the UI interaction.

+ // `popShow` controls the visibility of the page meta style.
+ // `handleChange` toggles the `popShow` state.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
const popShow = ref<boolean>(true);
function handleChange() {
popShow.value = !popShow.value;
}
// `popShow` controls the visibility of the page meta style.
const popShow = ref<boolean>(true);
// `handleChange` toggles the `popShow` state.
function handleChange() {
popShow.value = !popShow.value;
}

</script>

<template>

<view class="content">
<image class="logo" src="/static/logo.png" />
<view class="text-area">
<text class="title">{{ title }}</text>
</view>
<button @click="handleChange">change page meta</button>
<view class="long-block"></view>
</view>
</template>

Expand Down Expand Up @@ -43,4 +49,7 @@ const title = ref<string>("Hello");
font-size: 36rpx;
color: #8f8f94;
}
.long-block {
height: 2000rpx;
}
</style>
6 changes: 3 additions & 3 deletions playground/src/uni-pages.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// Generated by vite-plugin-uni-pages

interface NavigateToOptions {
url: "pages/index/index" |
"pages/index/disabled" |
"pages/index/uni-layout";
url: "/pages/index/index" |
"/pages/index/disabled" |
"/pages/index/uni-layout";
}
interface RedirectToOptions extends NavigateToOptions {}

Expand Down
6 changes: 3 additions & 3 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import UniPages from '@uni-helper/vite-plugin-uni-pages'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
// @ts-expect-error ignore
UniPages({
subPackages: [
'pages-sub',
],
dts: 'src/uni-pages.d.ts',
}),
// @ts-expect-error ignore
UniLayouts(),
UniLayouts({
teleportRootEl: '<page-meta :page-style="\'overflow:\'+(popShow?\'hidden\':\'visible\')"></page-meta>'
}),
uni(),
],
})
Loading