master
Aiden 3 months ago
parent 21086b78a8
commit 1eac28906e

@ -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

File diff suppressed because it is too large Load Diff

@ -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);
}
}

@ -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 { createSSRApp } from "vue";
import App from "./App.vue"; import App from "./App.vue";
import * as Pinia from 'pinia'; import * as Pinia from "pinia";
import globalComponents from "./components";
export function createApp() { export function createApp() {
const app = createSSRApp(App); const app = createSSRApp(App);
app.use(Pinia.createPinia()); app.use(Pinia.createPinia());
globalComponents(app);
return { return {
app, app,
Pinia, // 此处必须将 Pinia 返回 Pinia, // 此处必须将 Pinia 返回

@ -3,7 +3,11 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false //
}
} }
} }
], ],

@ -1,31 +1,11 @@
<template> <template>
<view class="content"> <view class="content">
<image class="logo" src="/static/logo.png" /> <navBar> </navBar>
<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>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' 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()
</script> </script>
<style> <style>

Loading…
Cancel
Save