فهرست منبع

样式展示成功

yuanmingze 8 ماه پیش
والد
کامیت
a7eb2d2ade
7فایلهای تغییر یافته به همراه30 افزوده شده و 21 حذف شده
  1. 1 0
      .npmrc
  2. 1 1
      components.d.ts
  3. 15 0
      src/App.ku.vue
  4. 7 7
      src/App.vue
  5. 2 0
      src/main.ts
  6. 0 0
      src/style/variable.scss
  7. 4 13
      vite.config.ts

+ 1 - 0
.npmrc

@@ -0,0 +1 @@
+public-hoist-pattern[]=@vue*

+ 1 - 1
components.d.ts

@@ -7,6 +7,6 @@ export {}
 
 declare module 'vue' {
   export interface GlobalComponents {
-    NutButton: typeof import('nutui-uniapp/components/button/button.vue')['default']
+    WdButton: typeof import('wot-design-uni/components/wd-button/wd-button.vue')['default']
   }
 }

+ 15 - 0
src/App.ku.vue

@@ -0,0 +1,15 @@
+<script setup lang="ts">
+import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
+onLaunch(() => {
+  console.log('App Launch')
+})
+onShow(() => {
+  console.log('App Show')
+})
+onHide(() => {
+  console.log('App Hide')
+})
+</script>
+<style lang="scss">
+// @import '@/styles/variable.scss';
+</style>

+ 7 - 7
src/App.vue

@@ -1,13 +1,13 @@
 <script setup lang="ts">
-import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
+import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
 onLaunch(() => {
-  console.log("App Launch");
-});
+  console.log('App Launch')
+})
 onShow(() => {
-  console.log("App Show");
-});
+  console.log('App Show')
+})
 onHide(() => {
-  console.log("App Hide");
-});
+  console.log('App Hide')
+})
 </script>
 <style></style>

+ 2 - 0
src/main.ts

@@ -1,6 +1,8 @@
 import { createSSRApp } from 'vue'
 import { setupStore } from '@/stores'
 
+
+
 import App from './App.vue'
 export function createApp() {
   const app = createSSRApp(App)

+ 0 - 0
src/style/variable.scss


+ 4 - 13
vite.config.ts

@@ -1,7 +1,7 @@
 import { defineConfig } from 'vite'
 import uni from '@dcloudio/vite-plugin-uni'
 import AutoImport from 'unplugin-auto-import/vite'
-import UniComponents from '@uni-helper/vite-plugin-uni-components'
+import Components from '@uni-helper/vite-plugin-uni-components'
 import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
 
 export default defineConfig(async () => {
@@ -10,27 +10,18 @@ export default defineConfig(async () => {
   return {
     plugins: [
       tsconfigPaths(),
-
-      uni(),
-
       AutoImport({
         imports: ['vue', 'pinia'],
         dts: 'src/auto-imports.d.ts',
       }),
 
       // ✅ 用 uni-helper 的组件插件
-      UniComponents({
-        dts: 'src/components.d.ts',
+      Components({
         resolvers: [WotResolver()],
       }),
+      uni(),
     ],
 
-    css: {
-      preprocessorOptions: {
-        scss: {
-          quietDeps: true,
-        },
-      },
-    },
+    css: {},
   }
 })