fantasia-ui 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +103 -0
- package/dist/components/modules/FTable.vue.d.ts +36 -1
- package/dist/fantasia-ui.es.js +13900 -9259
- package/dist/fantasia-ui.umd.js +46 -45
- package/dist/index.css +1 -1
- package/dist/types/modules/f-table.d.ts +14 -0
- package/package.json +1 -1
package/README.en.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Fantasia UI Component Library
|
|
2
|
+
|
|
3
|
+
### Upload Component
|
|
4
|
+
|
|
5
|
+
*For detailed API usage, refer to [Secondary encapsulation based on el-upload to achieve multi-functional upload - CSDN Blog](https://blog.csdn.net/weixin_60818087/article/details/148193542?spm=1001.2014.3001.5502)*
|
|
6
|
+
|
|
7
|
+
> Import styles in `main.ts`: `import 'fantasia-ui/dist/index.css'`
|
|
8
|
+
>
|
|
9
|
+
> Missing icons? You need to install **Element-plus** icons for them to display.
|
|
10
|
+
|
|
11
|
+
```vue
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { FUpload } from 'fantasia-ui';
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
components: {
|
|
17
|
+
FUpload
|
|
18
|
+
},
|
|
19
|
+
methods: {
|
|
20
|
+
handleUpload: (file, done, error) => {
|
|
21
|
+
try {
|
|
22
|
+
console.log(file);
|
|
23
|
+
done();
|
|
24
|
+
} catch (err) {
|
|
25
|
+
error(err);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<FUpload crop mosaic @upload="handleUpload" />
|
|
34
|
+
</template>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Table Component
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<script lang="ts" setup>
|
|
41
|
+
import { FTable } from 'fantasia-ui';
|
|
42
|
+
import type { Actions, Columns } from 'fantasia-ui/dist';
|
|
43
|
+
import { reactive } from 'vue';
|
|
44
|
+
|
|
45
|
+
const data = [
|
|
46
|
+
{
|
|
47
|
+
id: 1,
|
|
48
|
+
nickname: 'Test User'
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
const columns = reactive<Columns[]>([
|
|
53
|
+
{
|
|
54
|
+
prop: 'id',
|
|
55
|
+
label: 'ID'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
prop: 'nickname',
|
|
59
|
+
label: 'Nickname'
|
|
60
|
+
}
|
|
61
|
+
])
|
|
62
|
+
|
|
63
|
+
const actions = reactive<Actions[]>([
|
|
64
|
+
{
|
|
65
|
+
action: 'switch',
|
|
66
|
+
event: 'change',
|
|
67
|
+
prop: 'change',
|
|
68
|
+
config: {
|
|
69
|
+
activeText: 'Enable',
|
|
70
|
+
inactiveText: 'Disable',
|
|
71
|
+
activeValue: 0,
|
|
72
|
+
inactiveValue: 1
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
action: 'button',
|
|
77
|
+
event: 'delete',
|
|
78
|
+
label: 'Delete',
|
|
79
|
+
type: 'danger',
|
|
80
|
+
icon: 'delete'
|
|
81
|
+
}
|
|
82
|
+
])
|
|
83
|
+
|
|
84
|
+
const handleAction = (row: any, event: string) => {
|
|
85
|
+
switch (event) {
|
|
86
|
+
case 'change':
|
|
87
|
+
console.log("Switched");
|
|
88
|
+
break;
|
|
89
|
+
case 'delete':
|
|
90
|
+
console.log("Deleted");
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<template>
|
|
97
|
+
<FTable :data="data" :columns="columns" :actions="actions" @action="handleAction">
|
|
98
|
+
<template #id="{ row }">
|
|
99
|
+
<h1>{{ row }}</h1>
|
|
100
|
+
</template>
|
|
101
|
+
</FTable>
|
|
102
|
+
</template>
|
|
103
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import { Actions, Columns, Data } from '../../types';
|
|
2
|
+
import { Actions, Columns, Data, Pagination } from '../../types';
|
|
3
3
|
declare function __VLS_template(): {
|
|
4
4
|
attrs: Partial<{}>;
|
|
5
5
|
slots: Readonly<{
|
|
@@ -65,7 +65,24 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
65
65
|
children: string;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
+
pagination: {
|
|
69
|
+
type: PropType<Pagination>;
|
|
70
|
+
default: () => {
|
|
71
|
+
enable: boolean;
|
|
72
|
+
options: {
|
|
73
|
+
currentPage: number;
|
|
74
|
+
pageSize: number;
|
|
75
|
+
total: number;
|
|
76
|
+
layout: string;
|
|
77
|
+
pageSizes: number[];
|
|
78
|
+
pagerCount: number;
|
|
79
|
+
justifyContent: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
68
83
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
84
|
+
"update:pageSize": (...args: any[]) => void;
|
|
85
|
+
"update:currentPage": (...args: any[]) => void;
|
|
69
86
|
action: (...args: any[]) => void;
|
|
70
87
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
71
88
|
columns: {
|
|
@@ -97,7 +114,24 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
97
114
|
children: string;
|
|
98
115
|
};
|
|
99
116
|
};
|
|
117
|
+
pagination: {
|
|
118
|
+
type: PropType<Pagination>;
|
|
119
|
+
default: () => {
|
|
120
|
+
enable: boolean;
|
|
121
|
+
options: {
|
|
122
|
+
currentPage: number;
|
|
123
|
+
pageSize: number;
|
|
124
|
+
total: number;
|
|
125
|
+
layout: string;
|
|
126
|
+
pageSizes: number[];
|
|
127
|
+
pagerCount: number;
|
|
128
|
+
justifyContent: string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
};
|
|
100
132
|
}>> & Readonly<{
|
|
133
|
+
"onUpdate:pageSize"?: (...args: any[]) => any;
|
|
134
|
+
"onUpdate:currentPage"?: (...args: any[]) => any;
|
|
101
135
|
onAction?: (...args: any[]) => any;
|
|
102
136
|
}>, {
|
|
103
137
|
data: Data[];
|
|
@@ -108,6 +142,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
108
142
|
treeProps: {
|
|
109
143
|
children: string;
|
|
110
144
|
};
|
|
145
|
+
pagination: Pagination;
|
|
111
146
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
112
147
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
113
148
|
export default _default;
|