mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-04 13:42:27 +08:00
15
.eslintrc.js
15
.eslintrc.js
@@ -38,19 +38,12 @@ module.exports = defineConfig({
|
|||||||
'@typescript-eslint/ban-types': 'off',
|
'@typescript-eslint/ban-types': 'off',
|
||||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': [
|
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '.*', args: 'none' }],
|
||||||
'error',
|
|
||||||
{
|
|
||||||
argsIgnorePattern: '^_',
|
|
||||||
varsIgnorePattern: '^_',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'no-unused-vars': [
|
'no-unused-vars': [
|
||||||
'error',
|
'error',
|
||||||
{
|
// we are only using this rule to check for unused arguments since TS
|
||||||
argsIgnorePattern: '^_',
|
// catches unused variables but not args.
|
||||||
varsIgnorePattern: '^_',
|
{ varsIgnorePattern: '.*', args: 'none' },
|
||||||
},
|
|
||||||
],
|
],
|
||||||
'space-before-function-paren': 'off',
|
'space-before-function-paren': 'off',
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { TableBaseColumn } from 'naive-ui/lib/data-table/src/interface';
|
import type { InternalRowData, TableBaseColumn } from 'naive-ui/lib/data-table/src/interface';
|
||||||
import { ComponentType } from './componentType';
|
import { ComponentType } from './componentType';
|
||||||
export interface BasicColumn extends TableBaseColumn {
|
export interface BasicColumn<T = InternalRowData> extends TableBaseColumn<T> {
|
||||||
//编辑表格
|
//编辑表格
|
||||||
edit?: boolean;
|
edit?: boolean;
|
||||||
editRow?: boolean;
|
editRow?: boolean;
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
import { NAvatar } from 'naive-ui';
|
import { NAvatar } from 'naive-ui';
|
||||||
|
import { BasicColumn } from '@/components/Table';
|
||||||
export const columns = [
|
export interface ListData {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
avatar: string;
|
||||||
|
address: string;
|
||||||
|
beginTime: string;
|
||||||
|
endTime: string;
|
||||||
|
date: string;
|
||||||
|
}
|
||||||
|
export const columns: BasicColumn<ListData>[] = [
|
||||||
{
|
{
|
||||||
title: 'id',
|
title: 'id',
|
||||||
key: 'id',
|
key: 'id',
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<BasicTable
|
<BasicTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:request="loadDataTable"
|
:request="loadDataTable"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row:ListData) => row.id"
|
||||||
ref="actionRef"
|
ref="actionRef"
|
||||||
:actionColumn="actionColumn"
|
:actionColumn="actionColumn"
|
||||||
@update:checked-row-keys="onCheckedRow"
|
@update:checked-row-keys="onCheckedRow"
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
import { BasicTable, TableAction } from '@/components/Table';
|
import { BasicTable, TableAction } from '@/components/Table';
|
||||||
import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
|
import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
|
||||||
import { getTableList } from '@/api/table/list';
|
import { getTableList } from '@/api/table/list';
|
||||||
import { columns } from './columns';
|
import { columns, ListData } from './columns';
|
||||||
import { PlusOutlined } from '@vicons/antd';
|
import { PlusOutlined } from '@vicons/antd';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { type FormRules } from 'naive-ui';
|
import { type FormRules } from 'naive-ui';
|
||||||
|
|||||||
@@ -20,9 +20,6 @@
|
|||||||
"dom",
|
"dom",
|
||||||
"esnext"
|
"esnext"
|
||||||
],
|
],
|
||||||
"types": [
|
|
||||||
"vite/client"
|
|
||||||
],
|
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"./node_modules/@types/",
|
"./node_modules/@types/",
|
||||||
"./types"
|
"./types"
|
||||||
|
|||||||
1
types/modules.d.ts
vendored
1
types/modules.d.ts
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
declare module '*.vue' {
|
declare module '*.vue' {
|
||||||
import { DefineComponent } from 'vue';
|
import { DefineComponent } from 'vue';
|
||||||
const Component: DefineComponent<{}, {}, any>;
|
const Component: DefineComponent<{}, {}, any>;
|
||||||
|
|||||||
Reference in New Issue
Block a user