- Added typings for additional uni-components to improve type safety and code clarity. - Created a new file `type.d.ts` to declare the `ROUTES` constant. npmrc: Add .npmrc file - Added a new `.npmrc` file to configure hoisting patterns for public packages. - The file includes patterns for hoisting `@vue*` packages and an optional setting for `shamefully-hoist`. refactor: Remove unused user store - Deleted the `src/stores/user.ts` file as it is no longer needed. - The functionality provided by the user store has been replaced by other stores. tsconfig.json: Add wot-design-uni/global to types - Updated the `tsconfig.json` file to include the `wot-design-uni/global` type definition. - This allows for better type checking and autocompletion when using the `wot-design-uni` library. feat: Add useTabbar store - Created a new store `useTabbar` in the `src/stores/useTabbar.ts` file. - The store provides reactive state for managing the active tab in the tab bar. refactor: Update App.vue - Updated the `src/App.vue` file to import and use the `useTabbar` store. - Set the initial active tab to 'home' when the app is launched. feat: Add useConfig store - Created a new store `useConfig` in the `src/composables/useConfig.ts` file. - The store provides reactive state for managing the base URL used in API requests. feat: Add router configuration - Created a new file `src/router/index.ts` to configure the app's router. - Imported the `createRouter` function from the `uni-mini-router` library. - Imported the `pages.json` file and used `uni-parse-pages` to generate the routes. - Exported the created router instance. feat: Add persist plugin - Created a new file `src/stores/persist.ts` to implement a plugin for persisting store state. - The plugin uses `uni.getStorageSync` and `uni.setStorageSync` to store and retrieve store state from local storage. feat: Add page-wrapper component - Created a new file `src/components/page-wrapper.vue` to define a reusable page wrapper component. - The component includes a slot for content and adds a tab bar at the bottom of the page. feat: Add BussApi and user types - Created a new file `src/api/BussApi.ts` to define API methods for the business-related functionality. - Added types for the API request and response objects. - Created a new file `src/types/api/user.ts` to define types for the user-related API responses. chore: Update dependencies - Updated various dependencies in the `package.json` file. - Added `wot-design-uni` as a new dependency. - Updated `sass-loader` to version 10. feat: Add my page - Created a new file `src/pages/my/index.vue` to implement the "My" page. - Added API calls to fetch user profile information. - Added a logout button to log out the user and redirect to the login page. chore: Update pages.json - Updated the `pages.json` file to include the new "my" page and configure the tab bar. - Set the "home" page as the initial page.
22 lines
549 B
TypeScript
22 lines
549 B
TypeScript
import { defineConfig } from "vite";
|
|
import uni from "@dcloudio/vite-plugin-uni";
|
|
|
|
import Components from "@uni-helper/vite-plugin-uni-components";
|
|
import { WotResolver } from "@uni-helper/vite-plugin-uni-components/resolvers";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(async () => {
|
|
const UnoCSS = await import("unocss/vite").then((i) => i.default);
|
|
|
|
return {
|
|
plugins: [
|
|
Components({
|
|
resolvers: [WotResolver()],
|
|
}),
|
|
uni(),
|
|
// https://github.com/unocss/unocss
|
|
UnoCSS(),
|
|
],
|
|
};
|
|
});
|