boke-devops 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- package/.vscode/settings.json +2 -0
- package/lerna.json +4 -0
- package/package.json +43 -0
- package/packages/boke-devops-vue/.eslintrc.cjs +22 -0
- package/packages/boke-devops-vue/README.md +45 -0
- package/packages/boke-devops-vue/demo/App.vue +62 -0
- package/packages/boke-devops-vue/demo/main.ts +7 -0
- package/packages/boke-devops-vue/package-lock.json +13513 -0
- package/packages/boke-devops-vue/package.json +59 -0
- package/packages/boke-devops-vue/pnpm-lock.yaml +6063 -0
- package/packages/boke-devops-vue/src/AegisUser/__tests__/Avatar.test.js +18 -0
- package/packages/boke-devops-vue/src/AegisUser/__tests__/__snapshots__/Avatar.test.js.snap +60 -0
- package/packages/boke-devops-vue/src/AegisUser/multiple-user-select.vue +190 -0
- package/packages/boke-devops-vue/src/AegisUser/store.ts +23 -0
- package/packages/boke-devops-vue/src/AegisUser/user-avatar-group.vue +76 -0
- package/packages/boke-devops-vue/src/AegisUser/user-avatar.vue +347 -0
- package/packages/boke-devops-vue/src/Microapp/MicroAppProvider.vue +50 -0
- package/packages/boke-devops-vue/src/Provider/Provider.vue +22 -0
- package/packages/boke-devops-vue/src/Provider/store.ts +23 -0
- package/packages/boke-devops-vue/src/global.d.ts +43 -0
- package/packages/boke-devops-vue/src/index.ts +39 -0
- package/packages/boke-devops-vue/src/style/variables.less +79 -0
- package/packages/boke-devops-vue/tsconfig.json +34 -0
- package/packages/boke-devops-vue/tsconfig.web.json +20 -0
- package/packages/boke-devops-vue/types/AegisUser/multiple-user-select.vue.d.ts +97 -0
- package/packages/boke-devops-vue/types/AegisUser/store.d.ts +7 -0
- package/packages/boke-devops-vue/types/AegisUser/user-avatar-group.vue.d.ts +44 -0
- package/packages/boke-devops-vue/types/AegisUser/user-avatar.vue.d.ts +217 -0
- package/packages/boke-devops-vue/types/Microapp/MicroAppProvider.vue.d.ts +39 -0
- package/packages/boke-devops-vue/types/Provider/Provider.vue.d.ts +63 -0
- package/packages/boke-devops-vue/types/Provider/store.d.ts +15 -0
- package/packages/boke-devops-vue/types/index.d.ts +13 -0
- package/packages/boke-devops-vue/types/store.d.ts +12 -0
- package/packages/boke-devops-vue/vite.config.ts +90 -0
- package/packages/boke-docs/.dumirc.ts +64 -0
- package/packages/boke-docs/.eslintrc.js +14 -0
- package/packages/boke-docs/.fatherrc.ts +7 -0
- package/packages/boke-docs/README.md +1 -0
- package/packages/boke-docs/docs/components/Avatar/demo/normal.vue +25 -0
- package/packages/boke-docs/docs/components/Avatar/demo/with_provider.vue +38 -0
- package/packages/boke-docs/docs/components/Avatar/index.md +10 -0
- package/packages/boke-docs/docs/components/UserSelect/demo/normal.vue +34 -0
- package/packages/boke-docs/docs/components/UserSelect/demo/with_provider.vue +40 -0
- package/packages/boke-docs/docs/components/UserSelect/index.md +12 -0
- package/packages/boke-docs/docs/components/index.md +126 -0
- package/packages/boke-docs/docs/framework-test/external/App.vue +303 -0
- package/packages/boke-docs/docs/framework-test/index.md +96 -0
- package/packages/boke-docs/docs/index.md +50 -0
- package/packages/boke-docs/node_modules/.bin/acorn +17 -0
- package/packages/boke-docs/node_modules/.bin/acorn.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/acorn.ps1 +41 -0
- package/packages/boke-docs/node_modules/.bin/browserslist +17 -0
- package/packages/boke-docs/node_modules/.bin/browserslist.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/browserslist.ps1 +41 -0
- package/packages/boke-docs/node_modules/.bin/dumi +17 -0
- package/packages/boke-docs/node_modules/.bin/dumi.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/dumi.ps1 +41 -0
- package/packages/boke-docs/node_modules/.bin/eslint +17 -0
- package/packages/boke-docs/node_modules/.bin/eslint.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/eslint.ps1 +41 -0
- package/packages/boke-docs/node_modules/.bin/prettier +17 -0
- package/packages/boke-docs/node_modules/.bin/prettier.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/prettier.ps1 +41 -0
- package/packages/boke-docs/node_modules/.bin/stylelint +17 -0
- package/packages/boke-docs/node_modules/.bin/stylelint.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/stylelint.ps1 +41 -0
- package/packages/boke-docs/node_modules/.bin/tsc +17 -0
- package/packages/boke-docs/node_modules/.bin/tsc.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/tsc.ps1 +41 -0
- package/packages/boke-docs/node_modules/.bin/tsserver +17 -0
- package/packages/boke-docs/node_modules/.bin/tsserver.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/tsserver.ps1 +41 -0
- package/packages/boke-docs/node_modules/.bin/vite +17 -0
- package/packages/boke-docs/node_modules/.bin/vite.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/vite.ps1 +41 -0
- package/packages/boke-docs/node_modules/.bin/webpack +17 -0
- package/packages/boke-docs/node_modules/.bin/webpack.CMD +12 -0
- package/packages/boke-docs/node_modules/.bin/webpack.ps1 +41 -0
- package/packages/boke-docs/package.json +38 -0
- package/packages/boke-docs/pnpm-lock.yaml +11506 -0
- package/packages/boke-docs/tsconfig.json +14 -0
- package/packages/boke-docs/tsconfig.vue.json +10 -0
- package/packages/boke-js-bridge/es/child.d.ts +27 -0
- package/packages/boke-js-bridge/es/child.js +144 -0
- package/packages/boke-js-bridge/es/index.d.ts +3 -0
- package/packages/boke-js-bridge/es/index.js +3 -0
- package/packages/boke-js-bridge/es/parent.d.ts +24 -0
- package/packages/boke-js-bridge/es/parent.js +71 -0
- package/packages/boke-js-bridge/es/utils.d.ts +2 -0
- package/packages/boke-js-bridge/es/utils.js +6 -0
- package/packages/boke-js-bridge/package-lock.json +2028 -0
- package/packages/boke-js-bridge/package.json +35 -0
- package/packages/boke-js-bridge/readme.md +11 -0
- package/packages/boke-js-bridge/src/child.ts +174 -0
- package/packages/boke-js-bridge/src/index.ts +3 -0
- package/packages/boke-js-bridge/src/parent.ts +92 -0
- package/packages/boke-js-bridge/src/utils.ts +15 -0
- package/packages/boke-js-bridge/tsconfig.json +26 -0
- package/packages/boke-js-bridge/typings.d.ts +4 -0
- package/packages/boke-js-bridge/umd/child.js +156 -0
- package/packages/boke-js-bridge/umd/index.js +18 -0
- package/packages/boke-js-bridge/umd/parent.js +84 -0
- package/packages/boke-js-bridge/umd/utils.js +18 -0
- package/packages/test/Provider-test.vue +85 -0
- package/pnpm-workspace.yaml +2 -0
- package/scripts/configs.mjs +52 -0
- package/scripts/index.mjs +43 -0
- package/scripts/release.mjs +16 -0
- package/test-setup.js +24 -0
- package/vite.config.ts +21 -0
- package/vitest.config.js +22 -0
@@ -0,0 +1,126 @@
|
|
1
|
+
---
|
2
|
+
nav:
|
3
|
+
title: 指南
|
4
|
+
order: -1
|
5
|
+
group:
|
6
|
+
title: 介绍
|
7
|
+
order: -1
|
8
|
+
---
|
9
|
+
|
10
|
+
# 组件库
|
11
|
+
# 快速上手
|
12
|
+
|
13
|
+
@devops/boke-devops-vue 致力于提供给程序员**愉悦**的开发体验。
|
14
|
+
|
15
|
+
> 在开始之前,推荐先学习 [Vue](https://www.vuejs.org/) 和 [ES2015](http://babeljs.io/docs/learn-es2015/),并正确安装和配置了 [Node.js](https://nodejs.org/) v8.9 或以上。官方指南假设你已了解关于 HTML、CSS 和 JavaScript 的中级知识,并且已经完全掌握了 Vue 的正确开发方式。如果你刚开始学习前端或者 Vue,将 UI 框架作为你的第一步可能不是最好的主意。
|
16
|
+
|
17
|
+
## 在线演示
|
18
|
+
|
19
|
+
最简单的使用方式参照以下 CodeSandbox 演示,也推荐 Fork 本例来进行 `Bug Report`。
|
20
|
+
|
21
|
+
- [![Vue Antd Template](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/agitated-franklin-1w72v)
|
22
|
+
|
23
|
+
## 引入 @devops/boke-devops-vue
|
24
|
+
|
25
|
+
### 1. 新建项目
|
26
|
+
|
27
|
+
如果你需要新建一个项目,可以使用 [Vite](https://github.com/vitejs/vite)、[Rsbuild](https://github.com/web-infra-dev/rsbuild) 或 [Vue CLI](https://github.com/vuejs/vue-cli)。
|
28
|
+
|
29
|
+
请使用命令行来初始化项目:
|
30
|
+
|
31
|
+
- Vite:
|
32
|
+
|
33
|
+
```bash
|
34
|
+
$ npm create vite@latest
|
35
|
+
```
|
36
|
+
|
37
|
+
- Rsbuild:
|
38
|
+
|
39
|
+
```bash
|
40
|
+
$ npm create rsbuild@latest
|
41
|
+
```
|
42
|
+
|
43
|
+
- Vue CLI:
|
44
|
+
|
45
|
+
```bash
|
46
|
+
$ npm install -g @vue/cli
|
47
|
+
# OR
|
48
|
+
$ yarn global add @vue/cli
|
49
|
+
|
50
|
+
$ vue create antd-demo
|
51
|
+
```
|
52
|
+
|
53
|
+
> Vue CLI 已经停止迭代,因此不推荐使用。
|
54
|
+
|
55
|
+
若安装缓慢报错,可尝试用 `cnpm` 或别的镜像源自行安装:`rm -rf node_modules && cnpm install`。
|
56
|
+
|
57
|
+
### 2. 使用组件
|
58
|
+
|
59
|
+
#### 安装
|
60
|
+
|
61
|
+
```bash
|
62
|
+
$ npm i --save @devops/boke-devops-vue@4.x
|
63
|
+
```
|
64
|
+
|
65
|
+
#### 注册
|
66
|
+
|
67
|
+
如果使用 Vue 默认的模板语法,需要注册组件后方可使用,有如下三种方式注册组件:
|
68
|
+
|
69
|
+
**全局完整注册**
|
70
|
+
|
71
|
+
```
|
72
|
+
import { createApp } from 'vue';
|
73
|
+
import Antd from '@devops/boke-devops-vue';
|
74
|
+
import App from './App';
|
75
|
+
import '@devops/boke-devops-vue/dist/reset.css';
|
76
|
+
|
77
|
+
const app = createApp(App);
|
78
|
+
|
79
|
+
app.use(Antd).mount('#app');
|
80
|
+
```
|
81
|
+
|
82
|
+
以上代码便完成了 Antd 的全局注册。需要注意的是,样式文件需要单独引入。
|
83
|
+
|
84
|
+
**全局部分注册**
|
85
|
+
|
86
|
+
```
|
87
|
+
import { createApp } from 'vue';
|
88
|
+
import { Button, message } from '@devops/boke-devops-vue';
|
89
|
+
import App from './App';
|
90
|
+
|
91
|
+
const app = createApp(App);
|
92
|
+
|
93
|
+
/* 会自动注册 Button 下的子组件, 例如 Button.Group */
|
94
|
+
app.use(Button).mount('#app');
|
95
|
+
|
96
|
+
app.config.globalProperties.$message = message;
|
97
|
+
```
|
98
|
+
|
99
|
+
**局部注册组件**
|
100
|
+
|
101
|
+
此种方式需要分别注册组件子组件,如 Button、ButtonGroup,并且注册后仅在当前组件中有效。所以我们推荐使用上述两种方式。
|
102
|
+
|
103
|
+
```
|
104
|
+
<template>
|
105
|
+
<a-button>Add</a-button>
|
106
|
+
</template>
|
107
|
+
<script>
|
108
|
+
import { Button } from '@devops/boke-devops-vue';
|
109
|
+
const ButtonGroup = Button.Group;
|
110
|
+
|
111
|
+
export default {
|
112
|
+
components: {
|
113
|
+
AButton: Button,
|
114
|
+
AButtonGroup: ButtonGroup,
|
115
|
+
},
|
116
|
+
};
|
117
|
+
</script>
|
118
|
+
```
|
119
|
+
|
120
|
+
## 按需加载
|
121
|
+
|
122
|
+
`@devops/boke-devops-vue` 默认支持基于 ES modules 的 tree shaking,直接引入 `import { Button } from '@devops/boke-devops-vue';` 就会有按需加载的效果。
|
123
|
+
|
124
|
+
## 配置主题和字体
|
125
|
+
|
126
|
+
- [改变主题](/docs/vue/customize-theme-cn)
|
@@ -0,0 +1,303 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="m-4">
|
3
|
+
<p>Child options expand when clicked (default)</p>
|
4
|
+
<el-cascader
|
5
|
+
v-model="value"
|
6
|
+
:options="options"
|
7
|
+
@change="handleChange"
|
8
|
+
/>
|
9
|
+
</div>
|
10
|
+
<div class="m-4">
|
11
|
+
<p>Child options expand when hovered</p>
|
12
|
+
<el-cascader
|
13
|
+
v-model="value"
|
14
|
+
:options="options"
|
15
|
+
:props="props"
|
16
|
+
@change="handleChange"
|
17
|
+
/>
|
18
|
+
</div>
|
19
|
+
</template>
|
20
|
+
|
21
|
+
<script lang="ts" setup>
|
22
|
+
import { ref } from 'vue'
|
23
|
+
import { ElCascader, type CascaderValue } from 'element-plus'
|
24
|
+
|
25
|
+
const value = ref([])
|
26
|
+
|
27
|
+
const props = {
|
28
|
+
expandTrigger: 'hover' as const,
|
29
|
+
}
|
30
|
+
|
31
|
+
const handleChange = (value: CascaderValue) => {
|
32
|
+
console.log(value)
|
33
|
+
}
|
34
|
+
|
35
|
+
const options = [
|
36
|
+
{
|
37
|
+
value: 'guide',
|
38
|
+
label: 'Guide',
|
39
|
+
children: [
|
40
|
+
{
|
41
|
+
value: 'disciplines',
|
42
|
+
label: 'Disciplines',
|
43
|
+
children: [
|
44
|
+
{
|
45
|
+
value: 'consistency',
|
46
|
+
label: 'Consistency',
|
47
|
+
},
|
48
|
+
{
|
49
|
+
value: 'feedback',
|
50
|
+
label: 'Feedback',
|
51
|
+
},
|
52
|
+
{
|
53
|
+
value: 'efficiency',
|
54
|
+
label: 'Efficiency',
|
55
|
+
},
|
56
|
+
{
|
57
|
+
value: 'controllability',
|
58
|
+
label: 'Controllability',
|
59
|
+
},
|
60
|
+
],
|
61
|
+
},
|
62
|
+
{
|
63
|
+
value: 'navigation',
|
64
|
+
label: 'Navigation',
|
65
|
+
children: [
|
66
|
+
{
|
67
|
+
value: 'side nav',
|
68
|
+
label: 'Side Navigation',
|
69
|
+
},
|
70
|
+
{
|
71
|
+
value: 'top nav',
|
72
|
+
label: 'Top Navigation',
|
73
|
+
},
|
74
|
+
],
|
75
|
+
},
|
76
|
+
],
|
77
|
+
},
|
78
|
+
{
|
79
|
+
value: 'component',
|
80
|
+
label: 'Component',
|
81
|
+
children: [
|
82
|
+
{
|
83
|
+
value: 'basic',
|
84
|
+
label: 'Basic',
|
85
|
+
children: [
|
86
|
+
{
|
87
|
+
value: 'layout',
|
88
|
+
label: 'Layout',
|
89
|
+
},
|
90
|
+
{
|
91
|
+
value: 'color',
|
92
|
+
label: 'Color',
|
93
|
+
},
|
94
|
+
{
|
95
|
+
value: 'typography',
|
96
|
+
label: 'Typography',
|
97
|
+
},
|
98
|
+
{
|
99
|
+
value: 'icon',
|
100
|
+
label: 'Icon',
|
101
|
+
},
|
102
|
+
{
|
103
|
+
value: 'button',
|
104
|
+
label: 'Button',
|
105
|
+
},
|
106
|
+
],
|
107
|
+
},
|
108
|
+
{
|
109
|
+
value: 'form',
|
110
|
+
label: 'Form',
|
111
|
+
children: [
|
112
|
+
{
|
113
|
+
value: 'radio',
|
114
|
+
label: 'Radio',
|
115
|
+
},
|
116
|
+
{
|
117
|
+
value: 'checkbox',
|
118
|
+
label: 'Checkbox',
|
119
|
+
},
|
120
|
+
{
|
121
|
+
value: 'input',
|
122
|
+
label: 'Input',
|
123
|
+
},
|
124
|
+
{
|
125
|
+
value: 'input-number',
|
126
|
+
label: 'InputNumber',
|
127
|
+
},
|
128
|
+
{
|
129
|
+
value: 'select',
|
130
|
+
label: 'Select',
|
131
|
+
},
|
132
|
+
{
|
133
|
+
value: 'cascader',
|
134
|
+
label: 'Cascader',
|
135
|
+
},
|
136
|
+
{
|
137
|
+
value: 'switch',
|
138
|
+
label: 'Switch',
|
139
|
+
},
|
140
|
+
{
|
141
|
+
value: 'slider',
|
142
|
+
label: 'Slider',
|
143
|
+
},
|
144
|
+
{
|
145
|
+
value: 'time-picker',
|
146
|
+
label: 'TimePicker',
|
147
|
+
},
|
148
|
+
{
|
149
|
+
value: 'date-picker',
|
150
|
+
label: 'DatePicker',
|
151
|
+
},
|
152
|
+
{
|
153
|
+
value: 'datetime-picker',
|
154
|
+
label: 'DateTimePicker',
|
155
|
+
},
|
156
|
+
{
|
157
|
+
value: 'upload',
|
158
|
+
label: 'Upload',
|
159
|
+
},
|
160
|
+
{
|
161
|
+
value: 'rate',
|
162
|
+
label: 'Rate',
|
163
|
+
},
|
164
|
+
{
|
165
|
+
value: 'form',
|
166
|
+
label: 'Form',
|
167
|
+
},
|
168
|
+
],
|
169
|
+
},
|
170
|
+
{
|
171
|
+
value: 'data',
|
172
|
+
label: 'Data',
|
173
|
+
children: [
|
174
|
+
{
|
175
|
+
value: 'table',
|
176
|
+
label: 'Table',
|
177
|
+
},
|
178
|
+
{
|
179
|
+
value: 'tag',
|
180
|
+
label: 'Tag',
|
181
|
+
},
|
182
|
+
{
|
183
|
+
value: 'progress',
|
184
|
+
label: 'Progress',
|
185
|
+
},
|
186
|
+
{
|
187
|
+
value: 'tree',
|
188
|
+
label: 'Tree',
|
189
|
+
},
|
190
|
+
{
|
191
|
+
value: 'pagination',
|
192
|
+
label: 'Pagination',
|
193
|
+
},
|
194
|
+
{
|
195
|
+
value: 'badge',
|
196
|
+
label: 'Badge',
|
197
|
+
},
|
198
|
+
],
|
199
|
+
},
|
200
|
+
{
|
201
|
+
value: 'notice',
|
202
|
+
label: 'Notice',
|
203
|
+
children: [
|
204
|
+
{
|
205
|
+
value: 'alert',
|
206
|
+
label: 'Alert',
|
207
|
+
},
|
208
|
+
{
|
209
|
+
value: 'loading',
|
210
|
+
label: 'Loading',
|
211
|
+
},
|
212
|
+
{
|
213
|
+
value: 'message',
|
214
|
+
label: 'Message',
|
215
|
+
},
|
216
|
+
{
|
217
|
+
value: 'message-box',
|
218
|
+
label: 'MessageBox',
|
219
|
+
},
|
220
|
+
{
|
221
|
+
value: 'notification',
|
222
|
+
label: 'Notification',
|
223
|
+
},
|
224
|
+
],
|
225
|
+
},
|
226
|
+
{
|
227
|
+
value: 'navigation',
|
228
|
+
label: 'Navigation',
|
229
|
+
children: [
|
230
|
+
{
|
231
|
+
value: 'menu',
|
232
|
+
label: 'Menu',
|
233
|
+
},
|
234
|
+
{
|
235
|
+
value: 'tabs',
|
236
|
+
label: 'Tabs',
|
237
|
+
},
|
238
|
+
{
|
239
|
+
value: 'breadcrumb',
|
240
|
+
label: 'Breadcrumb',
|
241
|
+
},
|
242
|
+
{
|
243
|
+
value: 'dropdown',
|
244
|
+
label: 'Dropdown',
|
245
|
+
},
|
246
|
+
{
|
247
|
+
value: 'steps',
|
248
|
+
label: 'Steps',
|
249
|
+
},
|
250
|
+
],
|
251
|
+
},
|
252
|
+
{
|
253
|
+
value: 'others',
|
254
|
+
label: 'Others',
|
255
|
+
children: [
|
256
|
+
{
|
257
|
+
value: 'dialog',
|
258
|
+
label: 'Dialog',
|
259
|
+
},
|
260
|
+
{
|
261
|
+
value: 'tooltip',
|
262
|
+
label: 'Tooltip',
|
263
|
+
},
|
264
|
+
{
|
265
|
+
value: 'popover',
|
266
|
+
label: 'Popover',
|
267
|
+
},
|
268
|
+
{
|
269
|
+
value: 'card',
|
270
|
+
label: 'Card',
|
271
|
+
},
|
272
|
+
{
|
273
|
+
value: 'carousel',
|
274
|
+
label: 'Carousel',
|
275
|
+
},
|
276
|
+
{
|
277
|
+
value: 'collapse',
|
278
|
+
label: 'Collapse',
|
279
|
+
},
|
280
|
+
],
|
281
|
+
},
|
282
|
+
],
|
283
|
+
},
|
284
|
+
{
|
285
|
+
value: 'resource',
|
286
|
+
label: 'Resource',
|
287
|
+
children: [
|
288
|
+
{
|
289
|
+
value: 'axure',
|
290
|
+
label: 'Axure Components',
|
291
|
+
},
|
292
|
+
{
|
293
|
+
value: 'sketch',
|
294
|
+
label: 'Sketch Templates',
|
295
|
+
},
|
296
|
+
{
|
297
|
+
value: 'docs',
|
298
|
+
label: 'Design Documentation',
|
299
|
+
},
|
300
|
+
],
|
301
|
+
},
|
302
|
+
]
|
303
|
+
</script>
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# Element Plus
|
2
|
+
|
3
|
+
暂不支持组件的全局导入,但支持按需导入
|
4
|
+
|
5
|
+
轻量级 Demo 只支持组件代码的导入,需自行导入样式
|
6
|
+
|
7
|
+
```vue
|
8
|
+
<template>
|
9
|
+
<el-button>{{ msg }}</el-button>
|
10
|
+
</template>
|
11
|
+
<script setup>
|
12
|
+
import { ref } from 'vue';
|
13
|
+
const msg = ref('我是 ElButton');
|
14
|
+
</script>
|
15
|
+
<script>
|
16
|
+
import { ElButton } from 'element-plus';
|
17
|
+
import 'element-plus/es/components/button/style/css';
|
18
|
+
export default {
|
19
|
+
components: { ElButton },
|
20
|
+
};
|
21
|
+
</script>
|
22
|
+
```
|
23
|
+
|
24
|
+
外置组件可以通过配置 webpack 来实现组件的自动导入或是按需导入
|
25
|
+
|
26
|
+
<code src="./external/App.vue"></code>
|
27
|
+
|
28
|
+
这里使用手动按需导入
|
29
|
+
|
30
|
+
```ts
|
31
|
+
// import AutoImport from 'unplugin-auto-import/webpack';
|
32
|
+
// import Components from 'unplugin-vue-components/webpack';
|
33
|
+
// import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
|
34
|
+
|
35
|
+
export default {
|
36
|
+
chainWebpack(memo) {
|
37
|
+
memo.plugin('unplugin-element-plus').use(
|
38
|
+
require('unplugin-element-plus/webpack')({
|
39
|
+
useSource: true,
|
40
|
+
}),
|
41
|
+
);
|
42
|
+
// memo.plugin('auto-import').use(AutoImport( {
|
43
|
+
// resolvers: [ElementPlusResolver()],
|
44
|
+
// }));
|
45
|
+
// memo.plugin('components').use(Components({
|
46
|
+
// resolvers: [ElementPlusResolver()],
|
47
|
+
// }));
|
48
|
+
return memo;
|
49
|
+
},
|
50
|
+
};
|
51
|
+
```
|
52
|
+
|
53
|
+
## TSX
|
54
|
+
|
55
|
+
```tsx
|
56
|
+
import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus';
|
57
|
+
import 'element-plus/es/components/breadcrumb/style/css';
|
58
|
+
import { defineComponent } from 'vue';
|
59
|
+
|
60
|
+
const tableData = [
|
61
|
+
{
|
62
|
+
date: '2016-05-03',
|
63
|
+
name: 'Tom',
|
64
|
+
address: 'No. 189, Grove St, Los Angeles',
|
65
|
+
},
|
66
|
+
{
|
67
|
+
date: '2016-05-02',
|
68
|
+
name: 'Tom',
|
69
|
+
address: 'No. 189, Grove St, Los Angeles',
|
70
|
+
},
|
71
|
+
{
|
72
|
+
date: '2016-05-04',
|
73
|
+
name: 'Tom',
|
74
|
+
address: 'No. 189, Grove St, Los Angeles',
|
75
|
+
},
|
76
|
+
{
|
77
|
+
date: '2016-05-01',
|
78
|
+
name: 'Tom',
|
79
|
+
address: 'No. 189, Grove St, Los Angeles',
|
80
|
+
},
|
81
|
+
];
|
82
|
+
export default defineComponent({
|
83
|
+
setup() {
|
84
|
+
return () => (
|
85
|
+
<ElBreadcrumb separator="/">
|
86
|
+
<ElBreadcrumbItem to={{ path: '/' }}>homepage</ElBreadcrumbItem>
|
87
|
+
<ElBreadcrumbItem>
|
88
|
+
<a href="/">promotion management</a>
|
89
|
+
</ElBreadcrumbItem>
|
90
|
+
<ElBreadcrumbItem>promotion list</ElBreadcrumbItem>
|
91
|
+
<ElBreadcrumbItem>promotion detail</ElBreadcrumbItem>
|
92
|
+
</ElBreadcrumb>
|
93
|
+
);
|
94
|
+
},
|
95
|
+
});
|
96
|
+
```
|
@@ -0,0 +1,50 @@
|
|
1
|
+
---
|
2
|
+
hero:
|
3
|
+
title: Boke-Devops-vue
|
4
|
+
description: BokeDevops前端开发组件库,适配桌面端的组件库,适合在 vue3.x 技术栈项目中使用。
|
5
|
+
actions:
|
6
|
+
- text: 马上开始吧🚀
|
7
|
+
link: /components/avatar
|
8
|
+
---
|
9
|
+
## 安装
|
10
|
+
|
11
|
+
:::code-group
|
12
|
+
|
13
|
+
```bash [npm]
|
14
|
+
npm install @devops/boke-devops-vue
|
15
|
+
```
|
16
|
+
|
17
|
+
```bash [yarn]
|
18
|
+
yarn add @devops/boke-devops-vue
|
19
|
+
```
|
20
|
+
|
21
|
+
```bash [pnpm]
|
22
|
+
pnpm add @devops/boke-devops-vue
|
23
|
+
```
|
24
|
+
:::
|
25
|
+
## 使用
|
26
|
+
|
27
|
+
使用组件,具体使用方式如下
|
28
|
+
### 基础使用
|
29
|
+
|
30
|
+
基础使用会全量注册所有组件,如果您的项目大规模使用组件,请放心使用这种方式。
|
31
|
+
|
32
|
+
```js
|
33
|
+
import { createApp } from 'vue';
|
34
|
+
import devops from '@devops/boke-devops-vue';
|
35
|
+
import App from './app.vue';
|
36
|
+
|
37
|
+
// 引入组件库的少量全局样式变量
|
38
|
+
import '@devops/boke-devops-vue/dist/style.css'; // 必须导入
|
39
|
+
|
40
|
+
const app = createApp(App);
|
41
|
+
app.use(devops);
|
42
|
+
```
|
43
|
+
## 浏览器兼容性
|
44
|
+
|
45
|
+
| [<img src="https://tdesign.gtimg.com/docs/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/> IE / Edge | [<img src="https://tdesign.gtimg.com/docs/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/>Firefox | [<img src="https://tdesign.gtimg.com/docs/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/>Chrome | [<img src="https://tdesign.gtimg.com/docs/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/>Safari |
|
46
|
+
| --- | --- | --- | --- |
|
47
|
+
| Edge >=84 | Firefox >=83 | Chrome >=84 | Safari >=14.1 |
|
48
|
+
|
49
|
+
|
50
|
+
详情参见[桌面端组件库浏览器兼容性说明](https://github.com/Tencent/tdesign/wiki/%E6%A1%8C%E9%9D%A2%E7%AB%AF%E7%BB%84%E4%BB%B6%E5%BA%93%E6%B5%8F%E8%A7%88%E5%99%A8%E5%85%BC%E5%AE%B9%E6%80%A7%E8%AF%B4%E6%98%8E)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
3
|
+
|
4
|
+
case `uname` in
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
6
|
+
esac
|
7
|
+
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
9
|
+
export NODE_PATH="/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/bin/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/acorn@8.12.0/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/node_modules"
|
10
|
+
else
|
11
|
+
export NODE_PATH="/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/bin/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/acorn@8.12.0/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
12
|
+
fi
|
13
|
+
if [ -x "$basedir/node" ]; then
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/bin/acorn" "$@"
|
15
|
+
else
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/bin/acorn" "$@"
|
17
|
+
fi
|
@@ -0,0 +1,12 @@
|
|
1
|
+
@SETLOCAL
|
2
|
+
@IF NOT DEFINED NODE_PATH (
|
3
|
+
@SET "NODE_PATH=C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\acorn@8.12.0\node_modules\acorn\bin\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\acorn@8.12.0\node_modules\acorn\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\acorn@8.12.0\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\node_modules"
|
4
|
+
) ELSE (
|
5
|
+
@SET "NODE_PATH=C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\acorn@8.12.0\node_modules\acorn\bin\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\acorn@8.12.0\node_modules\acorn\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\acorn@8.12.0\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\node_modules;%NODE_PATH%"
|
6
|
+
)
|
7
|
+
@IF EXIST "%~dp0\node.exe" (
|
8
|
+
"%~dp0\node.exe" "%~dp0\..\..\..\..\node_modules\.pnpm\acorn@8.12.0\node_modules\acorn\bin\acorn" %*
|
9
|
+
) ELSE (
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
11
|
+
node "%~dp0\..\..\..\..\node_modules\.pnpm\acorn@8.12.0\node_modules\acorn\bin\acorn" %*
|
12
|
+
)
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env pwsh
|
2
|
+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
3
|
+
|
4
|
+
$exe=""
|
5
|
+
$pathsep=":"
|
6
|
+
$env_node_path=$env:NODE_PATH
|
7
|
+
$new_node_path="C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\acorn@8.12.0\node_modules\acorn\bin\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\acorn@8.12.0\node_modules\acorn\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\acorn@8.12.0\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\node_modules"
|
8
|
+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
9
|
+
# Fix case when both the Windows and Linux builds of Node
|
10
|
+
# are installed in the same directory
|
11
|
+
$exe=".exe"
|
12
|
+
$pathsep=";"
|
13
|
+
} else {
|
14
|
+
$new_node_path="/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/bin/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/acorn@8.12.0/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/node_modules"
|
15
|
+
}
|
16
|
+
if ([string]::IsNullOrEmpty($env_node_path)) {
|
17
|
+
$env:NODE_PATH=$new_node_path
|
18
|
+
} else {
|
19
|
+
$env:NODE_PATH="$new_node_path$pathsep$env_node_path"
|
20
|
+
}
|
21
|
+
|
22
|
+
$ret=0
|
23
|
+
if (Test-Path "$basedir/node$exe") {
|
24
|
+
# Support pipeline input
|
25
|
+
if ($MyInvocation.ExpectingInput) {
|
26
|
+
$input | & "$basedir/node$exe" "$basedir/../../../../node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/bin/acorn" $args
|
27
|
+
} else {
|
28
|
+
& "$basedir/node$exe" "$basedir/../../../../node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/bin/acorn" $args
|
29
|
+
}
|
30
|
+
$ret=$LASTEXITCODE
|
31
|
+
} else {
|
32
|
+
# Support pipeline input
|
33
|
+
if ($MyInvocation.ExpectingInput) {
|
34
|
+
$input | & "node$exe" "$basedir/../../../../node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/bin/acorn" $args
|
35
|
+
} else {
|
36
|
+
& "node$exe" "$basedir/../../../../node_modules/.pnpm/acorn@8.12.0/node_modules/acorn/bin/acorn" $args
|
37
|
+
}
|
38
|
+
$ret=$LASTEXITCODE
|
39
|
+
}
|
40
|
+
$env:NODE_PATH=$env_node_path
|
41
|
+
exit $ret
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
3
|
+
|
4
|
+
case `uname` in
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
6
|
+
esac
|
7
|
+
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
9
|
+
export NODE_PATH="/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/browserslist@4.23.1/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/node_modules"
|
10
|
+
else
|
11
|
+
export NODE_PATH="/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/browserslist@4.23.1/node_modules:/mnt/c/Users/lizulong/Desktop/devops-components-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
12
|
+
fi
|
13
|
+
if [ -x "$basedir/node" ]; then
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/cli.js" "$@"
|
15
|
+
else
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/cli.js" "$@"
|
17
|
+
fi
|
@@ -0,0 +1,12 @@
|
|
1
|
+
@SETLOCAL
|
2
|
+
@IF NOT DEFINED NODE_PATH (
|
3
|
+
@SET "NODE_PATH=C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\browserslist@4.23.1\node_modules\browserslist\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\browserslist@4.23.1\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\node_modules"
|
4
|
+
) ELSE (
|
5
|
+
@SET "NODE_PATH=C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\browserslist@4.23.1\node_modules\browserslist\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\browserslist@4.23.1\node_modules;C:\Users\lizulong\Desktop\devops-components-vue\node_modules\.pnpm\node_modules;%NODE_PATH%"
|
6
|
+
)
|
7
|
+
@IF EXIST "%~dp0\node.exe" (
|
8
|
+
"%~dp0\node.exe" "%~dp0\..\..\..\..\node_modules\.pnpm\browserslist@4.23.1\node_modules\browserslist\cli.js" %*
|
9
|
+
) ELSE (
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
11
|
+
node "%~dp0\..\..\..\..\node_modules\.pnpm\browserslist@4.23.1\node_modules\browserslist\cli.js" %*
|
12
|
+
)
|