diff --git a/packages/demo/src/Table/fixedColumn.vue b/packages/demo/src/Table/fixedColumn.vue
index 242c0816..a7e48b91 100644
--- a/packages/demo/src/Table/fixedColumn.vue
+++ b/packages/demo/src/Table/fixedColumn.vue
@@ -2,7 +2,7 @@
import { reactive, ref } from 'vue'
import { VbenCellClick } from '../../../vbenComponents/src/table'
import { getTableData } from '../apis/table'
-import {columns,innerColumns,innerLabels} from './schemas'
+import {fixedColumns,innerColumns,innerLabels} from './schemas'
import type {Data} from './schemas'
const border = ref(false)
@@ -43,7 +43,7 @@ const cellClickEvent: VbenCellClick = ({ row }) => {
loading: loading,
stripe: striped,
}"
- :columns="columns"
+ :columns="fixedColumns"
:data="data.table.items"
@cell-click="cellClickEvent"
>
diff --git a/packages/demo/src/Table/schemas.ts b/packages/demo/src/Table/schemas.ts
index f78c39d1..910344fc 100644
--- a/packages/demo/src/Table/schemas.ts
+++ b/packages/demo/src/Table/schemas.ts
@@ -1,8 +1,53 @@
-
import { VbenColumns } from '../../../vbenComponents/src/table'
-
-export const columns: VbenColumns = [
+export interface Data {
+ table: {
+ items: any[]
+ total: number
+ }
+}
+export const baseColumns: VbenColumns = [
+ {
+ field: 'userId',
+ title: 'id',
+ align: 'center',
+ width: '10%',
+ },
+ {
+ field: 'username',
+ title: '名称',
+ width: '10%',
+ },
+ {
+ field: 'realname',
+ title: '真实名称',
+ width: '10%',
+ },
+ {
+ field: 'address',
+ title: '地址',
+ width: '10%',
+ },
+ {
+ field: 'startTime',
+ title: '开始时间',
+ align: 'center',
+ width: '10%',
+ },
+ {
+ field: 'endTime',
+ title: '结束时间',
+ align: 'center',
+ width: '10%',
+ },
+ {
+ field: 'desc',
+ title: '描述',
+ align: 'center',
+ width: '40%',
+ },
+]
+export const fixedColumns: VbenColumns = [
{ field: 'userId', title: 'id', width: 100, fixed: 'left' },
{ field: 'username', title: '名称', width: 120, fixed: 'left' },
{ field: 'realname', title: '真实名称', width: 280 },
@@ -13,7 +58,7 @@ export const columns: VbenColumns = [
field: 'desc',
title: '备注',
width: 280,
- fixed:'right'
+ fixed: 'right',
},
]
@@ -31,14 +76,3 @@ export const innerColumns: VbenColumns = [
{ field: 'label', title: 'label' },
{ field: 'value', title: 'value' },
]
-
-
-
-
-
-export interface Data {
- table: {
- items: any[]
- total: number
- }
-}
\ No newline at end of file
diff --git a/packages/vbenComponents/src/index.ts b/packages/vbenComponents/src/index.ts
index 6eb6530c..25606b0f 100644
--- a/packages/vbenComponents/src/index.ts
+++ b/packages/vbenComponents/src/index.ts
@@ -1,11 +1,11 @@
-import type { Component, App } from 'vue'
-import TabPane from '#/tabs/src/TabPane.vue'
+import type { App, Component } from 'vue'
const projectName = 'Vben3'
export const components = {
install: (app: App) => {
// @ts-ignore
- const comp = import.meta.globEager('./**/*.vue')
-
+ // const comp = import.meta.globEager('./**/*.vue')
+ /* 上面写法vite官方已弃用,详情见 https://cn.vitejs.dev/guide/migration-from-v2.html#importmetaglob */
+ const comp = import.meta.glob('./**/*.vue', {eager: true})
Object.keys(comp).forEach((k) => {
const c = comp[k].default
switch (c.__name) {
@@ -28,7 +28,7 @@ export const components = {
// console.log(c)
// 检测未注册组件
if (!maps.get(c.__name) && !c.name) {
- console.warn(c)
+ warn(c.__name)
return
}
app.component(`Vben${c.name || c.__name}`, c)
@@ -40,7 +40,7 @@ export const components = {
export const maps = new Map()
export function warn(message: string) {
- console.warn(`[${projectName} warn]:${message}`)
+ console.warn(`[${projectName} warn]:<${message}> components not registered!`)
}
export function error(message: string) {