st-comp 0.0.7 → 0.0.9

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.
@@ -1,27 +1,117 @@
1
- <template>
2
- <div :style="{ width: '100%', height: '600px' }">
3
- <st-table
4
- :data="data"
5
- :column="column"
6
- />
7
- </div>
8
- </template>
9
-
10
- <script setup lang="ts">
11
- const data = [
12
- { name: 'name1' },
13
- { name: 'name2' },
14
- { name: 'name3' },
15
- ]
16
-
17
- const column = [
18
- {
19
- label: '名称',
20
- prop: 'name',
21
- },
22
- ]
23
- </script>
24
-
25
- <style lang="scss" scoped>
26
-
27
- </style>
1
+ <template>
2
+ <div :style="{ width: '100%', height: '600px' }">
3
+ <st-table
4
+ :data="data"
5
+ :column="column"
6
+ >
7
+ <template #slotName="scope">
8
+ <h3>{{ scope.row.slotText }}</h3>
9
+ </template>
10
+ </st-table>
11
+ </div>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ const column = [
16
+ {
17
+ label: '名称',
18
+ prop: 'name',
19
+ width: '260px',
20
+ },
21
+ {
22
+ label: '自定义显示文案',
23
+ prop: 'name',
24
+ type: 'formatter',
25
+ formatter: (value: any) => `名称:${value}`
26
+ },
27
+ {
28
+ label: '自定义样式',
29
+ prop: 'color',
30
+ type: 'formatter',
31
+ style: (value: any) => {
32
+ return {
33
+ color: value
34
+ }
35
+ },
36
+ },
37
+ {
38
+ label: '插槽',
39
+ prop: 'slotText',
40
+ type: 'slot',
41
+ slot: 'slotName',
42
+ },
43
+ {
44
+ label: '操作',
45
+ prop: 'action',
46
+ type: 'btns',
47
+ width: '260px',
48
+ btns: [
49
+ {
50
+ text: (data: any) => {
51
+ return data.btnText as string
52
+ },
53
+ onClick: (data: any) => {
54
+ console.log(data)
55
+ },
56
+ },
57
+ {
58
+ text: '绩效分析',
59
+ disabled: (data: any) => {
60
+ return data.disabledBtn
61
+ },
62
+ onClick: (data: any) => {
63
+ console.log('绩效分析', data)
64
+ }
65
+ },
66
+ {
67
+ children: [
68
+ {
69
+ needCheck: {
70
+ title: '确认是否删除该项训练记录'
71
+ },
72
+ text: '删除',
73
+ onClick: (data: any) => {
74
+ console.log('删除', data)
75
+ }
76
+ },
77
+ {
78
+ text: '分享',
79
+ show: false,
80
+ onClick: (data: any) => {
81
+ console.log('分享', data)
82
+ }
83
+ },
84
+ ]
85
+ }
86
+ ]
87
+ }
88
+ ]
89
+
90
+ const data = [
91
+ {
92
+ name: 'name1',
93
+ btnText: '按钮1',
94
+ disabledBtn: true,
95
+ color: 'red',
96
+ slotText: '插槽内容1',
97
+ },
98
+ {
99
+ name: 'name2',
100
+ btnText: '按钮2',
101
+ disabledBtn: false,
102
+ color: 'green',
103
+ slotText: '插槽内容2',
104
+ },
105
+ {
106
+ name: 'name3',
107
+ btnText: '按钮3',
108
+ disabledBtn: false,
109
+ color: 'blue',
110
+ slotText: '插槽内容3',
111
+ },
112
+ ]
113
+ </script>
114
+
115
+ <style lang="scss" scoped>
116
+
117
+ </style>
@@ -1,27 +1,22 @@
1
1
  export default [
2
- {
3
- path: '/button',
4
- name: 'Button',
5
- component: () => import('@/pages/Button/index.vue'),
6
- },
7
2
  {
8
3
  path: '/echarts',
9
4
  name: 'Echarts',
10
- component: () => import('@/pages/Echarts/index.vue'),
5
+ component: () => import('../pages/Echarts/index.vue'),
11
6
  },
12
7
  {
13
8
  path: '/kline',
14
9
  name: 'Kline',
15
- component: () => import('@/pages/Kline/index.vue'),
10
+ component: () => import('../pages/Kline/index.vue'),
16
11
  },
17
12
  {
18
- path: '/list',
19
- name: 'List',
20
- component: () => import('@/pages/List/index.vue'),
13
+ path: '/pagination',
14
+ name: 'Pagination',
15
+ component: () => import('../pages/Pagination/index.vue'),
21
16
  },
22
17
  {
23
18
  path: '/table',
24
19
  name: 'Table',
25
- component: () => import('@/pages/Table/index.vue'),
20
+ component: () => import('../pages/Table/index.vue'),
26
21
  },
27
22
  ]
package/tsconfig.json CHANGED
@@ -5,7 +5,6 @@
5
5
  "module": "ESNext",
6
6
  "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
7
  "skipLibCheck": true,
8
-
9
8
  /* Bundler mode */
10
9
  "moduleResolution": "bundler",
11
10
  "allowImportingTsExtensions": true,
@@ -18,7 +17,13 @@
18
17
  "strict": true,
19
18
  "noUnusedLocals": true,
20
19
  "noUnusedParameters": true,
21
- "noFallthroughCasesInSwitch": true
20
+ "noFallthroughCasesInSwitch": true,
21
+
22
+ "baseUrl": ".",
23
+ "paths": {
24
+ "@/*": ["src/*"]
25
+ },
26
+
22
27
  },
23
28
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
24
29
  "references": [{ "path": "./tsconfig.node.json" }]
package/vite.config.ts CHANGED
@@ -28,9 +28,10 @@ export default defineConfig({
28
28
  external: ['vue', 'echarts', 'element-plus'],
29
29
  }
30
30
  },
31
+
31
32
  resolve: {
32
33
  alias: {
33
- '@': './src'
34
+ '@':'./src'
34
35
  }
35
36
  },
36
37
  server: {
@@ -52,7 +52,7 @@ export default {
52
52
  ${filterFiles.map(fileName => `{
53
53
  path: '/${toFirstLowerCase(fileName)}',
54
54
  name: '${fileName}',
55
- component: () => import('@/pages/${fileName}/index.vue'),
55
+ component: () => import('../pages/${fileName}/index.vue'),
56
56
  },`).join(`
57
57
  `)}
58
58
  ]
@@ -1,8 +0,0 @@
1
- import { App } from "vue";
2
- import StButton from "./index.vue";
3
-
4
- export default {
5
- install(app: App) {
6
- app.component("st-button", StButton);
7
- },
8
- }
@@ -1,9 +0,0 @@
1
- <template>
2
- <button>123456</button>
3
- </template>
4
- <script setup lang="ts">
5
- </script>
6
-
7
- <style scoped>
8
-
9
- </style>
@@ -1,8 +0,0 @@
1
- import { App } from "vue";
2
- import StList from "./index.vue";
3
-
4
- export default {
5
- install(app: App) {
6
- app.component("st-list", StList);
7
- },
8
- }
@@ -1,13 +0,0 @@
1
- <template>
2
- <ul>
3
- <li>1</li>
4
- <li>2</li>
5
- <li>3</li>
6
- </ul>
7
- </template>
8
- <script setup lang="ts" name="st-list">
9
- </script>
10
-
11
- <style scoped>
12
-
13
- </style>
@@ -1,12 +0,0 @@
1
- <template>
2
- <div>
3
- Button
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- </script>
9
-
10
- <style lang="scss" scoped>
11
-
12
- </style>
@@ -1,12 +0,0 @@
1
- <template>
2
- <div>
3
- List
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- </script>
9
-
10
- <style lang="scss" scoped>
11
-
12
- </style>