type: remove NxButtin componnet (#2590)

* type: remove NxButtin componnet

* Update scripts/gen-component-declaration.js

Co-authored-by: yugang.cao <yugang.cao@tusimple.ai>
Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
Yugang Cao 2022-03-09 11:53:03 +08:00 committed by GitHub
parent 0c12a97b01
commit 3cad05961c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,9 @@ import fs from 'fs-extra'
const TYPE_ROOT = resolve(__dirname, '..')
// XButton is for tsx type checking, shouldn't be exported
const excludeComponents = ['NxButton']
function exist (path) {
return fs.existsSync(path)
}
@ -23,7 +26,7 @@ async function generateComponentsType () {
const components = {}
Object.keys(globalComponents).forEach((key) => {
const entry = `typeof import('naive-ui')['${key}']`
if (key.startsWith('N')) {
if (key.startsWith('N') && !excludeComponents.includes(key)) {
components[key] = entry
}
})

1
volar.d.ts vendored
View File

@ -14,7 +14,6 @@ declare module 'vue' {
NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
NButton: typeof import('naive-ui')['NButton']
NButtonGroup: typeof import('naive-ui')['NButtonGroup']
NxButton: typeof import('naive-ui')['NxButton']
NCalendar: typeof import('naive-ui')['NCalendar']
NColorPicker: typeof import('naive-ui')['NColorPicker']
NCard: typeof import('naive-ui')['NCard']