fix
This commit is contained in:
parent
21086b78a8
commit
1eac28906e
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"i18n-ally.localesPaths": [
|
||||
"src/uni_modules/uv-calendars/components/uv-calendars/i18n"
|
||||
],
|
||||
"vue-i18n.i18nPaths": "src\\uni_modules\\uv-calendars\\components\\uv-calendars\\i18n"
|
||||
}
|
22770
package-lock.json
generated
Normal file
22770
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
10
src/components/index.ts
Normal file
10
src/components/index.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export default function globalComponents(app) {
|
||||
// 全局组件
|
||||
// @ts-ignore
|
||||
const components = import.meta.glob("./**/**.{vue,tsx}", { eager: true });
|
||||
for (let [key, value] of Object.entries(components)) {
|
||||
const name = key.replace("./", "").split("/")[0];
|
||||
// @ts-ignore
|
||||
app.component(value.default.name || name, value.default);
|
||||
}
|
||||
}
|
57
src/components/navBar/index.vue
Normal file
57
src/components/navBar/index.vue
Normal file
@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 建议放在外层 -->
|
||||
<uv-sticky>
|
||||
<uv-navbar fixed @leftClick="backhandle" safeAreaInsetTop>
|
||||
<template v-slot:left>
|
||||
<view class="uv-nav-slot">
|
||||
<uv-icon name="arrow-left" size="19" v-if="isShowLeft"></uv-icon>
|
||||
</view>
|
||||
</template>
|
||||
<template v-slot:right>
|
||||
<slot name="right"></slot>
|
||||
</template>
|
||||
<template v-slot:center>
|
||||
<slot name="center">
|
||||
<span style="font-size: 34rpx; font-weight: bold"
|
||||
>退画接收确认</span
|
||||
>
|
||||
</slot>
|
||||
</template>
|
||||
</uv-navbar>
|
||||
</uv-sticky>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
const isShowLeft = computed(() => {
|
||||
const pages = getCurrentPages();
|
||||
return pages.length === 1 ? false : true;
|
||||
});
|
||||
const backhandle = (): void => {
|
||||
// console.log(pages);
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length === 1) return;
|
||||
uni.navigateBack();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@mixin flex($direction: row) {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: $direction;
|
||||
}
|
||||
.uv-nav-slot {
|
||||
@include flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-width: 0.5px;
|
||||
border-radius: 100px;
|
||||
border-color: #dadbde;
|
||||
padding: 3px 7px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
</style>
|
@ -1,11 +1,11 @@
|
||||
import { createSSRApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
import * as Pinia from 'pinia';
|
||||
|
||||
import * as Pinia from "pinia";
|
||||
import globalComponents from "./components";
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App);
|
||||
app.use(Pinia.createPinia());
|
||||
|
||||
globalComponents(app);
|
||||
return {
|
||||
app,
|
||||
Pinia, // 此处必须将 Pinia 返回
|
||||
|
@ -3,7 +3,11 @@
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "uni-app"
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false,
|
||||
"app-plus": {
|
||||
"titleNView": false // 禁用原生导航
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1,31 +1,11 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<image class="logo" src="/static/logo.png" />
|
||||
<view class="text-area">
|
||||
<text class="title">{{ title }}</text>
|
||||
<!-- 直接从 store 中访问 state -->
|
||||
<text>Current Count: {{ counter.count }}</text>
|
||||
</view>
|
||||
<view class="w-full h-[100px] bg-[red] flex justify-center items-center">
|
||||
<text>Hello Tailwind CSS</text>
|
||||
</view>
|
||||
<view>
|
||||
<uv-button type="primary" text="uv-ui按钮"></uv-button>
|
||||
</view>
|
||||
<navBar> </navBar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useCounterStore } from '@/stores/counter'
|
||||
|
||||
const title = ref('Hello')
|
||||
const counter = useCounterStore();
|
||||
counter.count++
|
||||
// 自动补全!
|
||||
counter.$patch({ count: counter.count + 1 })
|
||||
// 或使用 action 代替
|
||||
counter.increment()
|
||||
import { ref } from "vue";
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
Loading…
Reference in New Issue
Block a user