We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
vite.config.js
import Components from 'unplugin-vue-components/vite' export default defineConfig({ plugins: [ uni(), Components({ dirs: ['src/components'] }) ] })
tsconfig.json
{ "extends": "@vue/tsconfig/tsconfig.json", "compilerOptions": { "sourceMap": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"] }, "lib": ["esnext", "dom"], "ignoreDeprecations": "5.0" }, "include": [ "src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "*.d.ts" ] }
components.d.ts
/* eslint-disable */ /* prettier-ignore */ // @ts-nocheck // Generated by unplugin-vue-components // Read more: https://github.com/vuejs/core/pull/3399 export {} declare module 'vue' { export interface GlobalComponents { MyNav: typeof import('./src/components/my-nav/my-nav.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } }
my-nav.vue
<template> <view class="bg-sky-500"> my-nav </view> </template>
效果图
直接使用,没有提示
手动引用,才有提示
The text was updated successfully, but these errors were encountered:
可以使用vite-plugin-uni-components代替,来解决这个问题
Sorry, something went wrong.
No branches or pull requests
vite.config.js
tsconfig.json
components.d.ts
my-nav.vue
效果图
直接使用,没有提示
手动引用,才有提示
The text was updated successfully, but these errors were encountered: