@yueglobal/vue-ui 1.0.0
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/LICENSE +21 -0
- package/README.md +154 -0
- package/components/ASvgIcon.vue.d.ts +34 -0
- package/components/DeclarationIcon.vue.d.ts +3 -0
- package/components/ExpoIcon.vue.d.ts +3 -0
- package/components/HomeIcon.vue.d.ts +3 -0
- package/components/HwcIcon.vue.d.ts +3 -0
- package/components/InsuranceIcon.vue.d.ts +3 -0
- package/components/LawIcon.vue.d.ts +3 -0
- package/components/LocationIcon.vue.d.ts +3 -0
- package/components/SelectionIcon.vue.d.ts +3 -0
- package/components/SingleWindowIcon.vue.d.ts +3 -0
- package/components/TaxationIcon.vue.d.ts +3 -0
- package/components/TradeDataIcon.vue.d.ts +3 -0
- package/components/TrainingIcon.vue.d.ts +3 -0
- package/components/icon-image/index.vue.d.ts +10 -0
- package/index.d.ts +2 -0
- package/index.mjs +8107 -0
- package/index.umd.js +104 -0
- package/package.json +29 -0
- package/style.css +1 -0
- package/yue-page-footer/data/privacy-policy.vue.d.ts +2 -0
- package/yue-page-footer/data/terms-of-service.vue.d.ts +2 -0
- package/yue-page-footer/index.vue.d.ts +3 -0
- package/yue-page-header/breadcrumb/index.vue.d.ts +3 -0
- package/yue-page-header/first-menus/index.vue.d.ts +785 -0
- package/yue-page-header/helper.d.ts +72 -0
- package/yue-page-header/index.vue.d.ts +3 -0
- package/yue-page-header/right-content/index.vue.d.ts +3 -0
- package/yue-page-header/second-menus/index.vue.d.ts +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# @yueglobal/vue-ui
|
|
2
|
+
|
|
3
|
+
粤链全球 - Vue 组件库
|
|
4
|
+
|
|
5
|
+
如需`React`版本,请前往 [@yueglobal/ui](https://www.npmjs.com/package/@yueglobal/ui)
|
|
6
|
+
|
|
7
|
+
## 安装使用
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
yarn add @yueglobal/vue-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import {
|
|
15
|
+
// 页面头部组件
|
|
16
|
+
YuePageHeader,
|
|
17
|
+
// 页面底部组件
|
|
18
|
+
YuePageFooter,
|
|
19
|
+
} from '@yueglobal/vue-ui';
|
|
20
|
+
|
|
21
|
+
// 引入样式文件
|
|
22
|
+
import '@yueglobal/vue-ui/style.css';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## YuePageHeader
|
|
26
|
+
|
|
27
|
+
页面头部组件,包含一级和二级导航菜单、面包屑、以及登录/用户信息等功能。
|
|
28
|
+
|
|
29
|
+
### 属性
|
|
30
|
+
|
|
31
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
32
|
+
| ----------------- | ----------------------------------- | ------------------------------------------- | ------ |
|
|
33
|
+
| `width` | 内容宽度 | `string` \| `number` | `80%` |
|
|
34
|
+
| `backgroundColor` | 头部背景色 | `string` | `#fff` |
|
|
35
|
+
| `rightContent` | 顶部右侧的登录/用户信息按钮 | `Component` | |
|
|
36
|
+
| `menuItems` | 各业务系统的菜单 | `YueMenuItem`[] | |
|
|
37
|
+
| `pageTitle` | 缺值时从一级菜单取值 | `string` | |
|
|
38
|
+
| `pageIcon` | 页面图标 | `string` \| `Component` | |
|
|
39
|
+
| `breadcrumbs` | 自定义面包屑数据 | `YueBreadcrumb`[] | |
|
|
40
|
+
| `routes` | 路由数据,用于自动生成面包屑 | any | |
|
|
41
|
+
| `pathname` | 当前的路由 | `string` | |
|
|
42
|
+
| `onRouteChange` | 点击菜单/面包屑时触发的路由切换事件 | `({ key: string; label?: string }) => void` | |
|
|
43
|
+
| `onLocaleChange` | 切换语言时的回调事件 | `({locale: string}) => void` | |
|
|
44
|
+
|
|
45
|
+
- 业务子系统:`pageTitle`或`pageIcon`缺省时会根据`url`自动从一级菜单匹配值
|
|
46
|
+
|
|
47
|
+
- 面包屑:若`breadcrumbs`缺省,则会根据`routes`、`pathname`自动生成面包屑的数据
|
|
48
|
+
|
|
49
|
+
- `routes`是`vue`的路由列表,需按如下方式取值:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import { useRouter } from 'vue-router';
|
|
53
|
+
// .......
|
|
54
|
+
const routes = useRouter().getRoutes();
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### YueMenuItem
|
|
58
|
+
|
|
59
|
+
| 属性 | 说明 | 类型 | 备注 |
|
|
60
|
+
| ---------- | ---------- | --------------- | ------------------------------ |
|
|
61
|
+
| `key` | 唯一标识 | `string` | `必填`,可传路由地址如 `/home` |
|
|
62
|
+
| `label` | 菜单项文案 | `string` | `必填` |
|
|
63
|
+
| `children` | 子菜单项 | `YueMenuItem`[] | |
|
|
64
|
+
|
|
65
|
+
### YueBreadcrumb
|
|
66
|
+
|
|
67
|
+
| 属性 | 说明 | 类型 | 备注 |
|
|
68
|
+
| ------- | ---------------------- | -------- | ---------------------- |
|
|
69
|
+
| `key` | 唯一标识,用于路由跳转 | `string` | 可传路由地址如 `/home` |
|
|
70
|
+
| `label` | 面包屑项文案 | `string` | |
|
|
71
|
+
|
|
72
|
+
### 使用示例
|
|
73
|
+
|
|
74
|
+
```vue | pure
|
|
75
|
+
<script>
|
|
76
|
+
import { ref } from 'vue';
|
|
77
|
+
import { useRouter, useRoute } from 'vue-router';
|
|
78
|
+
import { YuePageHeader } from '@yueglobal/vue-ui';
|
|
79
|
+
import RightContent from './right-content.vue';
|
|
80
|
+
|
|
81
|
+
const route = useRoute();
|
|
82
|
+
const routes = useRouter().getRoutes();
|
|
83
|
+
|
|
84
|
+
const pathname = ref(route.path);
|
|
85
|
+
const menuItems = ref([
|
|
86
|
+
{ key: '/home', label: '首页' },
|
|
87
|
+
{
|
|
88
|
+
key: '/exhibition',
|
|
89
|
+
label: '展会',
|
|
90
|
+
children: [
|
|
91
|
+
{ key: '/exhibition/international', label: '国际展会' },
|
|
92
|
+
{ key: '/exhibition/domestic', label: '国内展会' },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
{ key: '/business', label: '商务' },
|
|
96
|
+
]);
|
|
97
|
+
// 顶部右侧的 登录/用户信息 组件
|
|
98
|
+
const rightContent = ref(RightContent);
|
|
99
|
+
|
|
100
|
+
// 监听路由变化
|
|
101
|
+
watch(
|
|
102
|
+
() => route.path,
|
|
103
|
+
(newPath) => {
|
|
104
|
+
pathname.value = newPath;
|
|
105
|
+
},
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
function onRouteChange({ key, label }) {
|
|
109
|
+
// 在这里处理路由跳转逻辑, 比如
|
|
110
|
+
if (key.startsWith('/')) {
|
|
111
|
+
history.push(key);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function onLocaleChange({ locale }) {
|
|
116
|
+
console.log('切换语言为:', locale);
|
|
117
|
+
}
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<template>
|
|
121
|
+
<yue-page-header
|
|
122
|
+
width="1440px"
|
|
123
|
+
pageTitle="出海培训"
|
|
124
|
+
:menuItems="menuItems"
|
|
125
|
+
:pathname="pathname"
|
|
126
|
+
:routes="routes"
|
|
127
|
+
:breadcrumbs="breadcrumbs"
|
|
128
|
+
:right-content="rightContent"
|
|
129
|
+
@route-change="onRouteChange"
|
|
130
|
+
@locale-change="onLocaleChange"
|
|
131
|
+
/>
|
|
132
|
+
</template>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## YuePageFooter
|
|
136
|
+
|
|
137
|
+
页面底部组件,显示版权信息、联系方式和相关链接。
|
|
138
|
+
|
|
139
|
+
### 属性
|
|
140
|
+
|
|
141
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
142
|
+
| ------- | -------- | -------------------- | ------ |
|
|
143
|
+
| `width` | 内容宽度 | `string` \| `number` | `80%` |
|
|
144
|
+
|
|
145
|
+
### 使用示例
|
|
146
|
+
|
|
147
|
+
```vue | pure
|
|
148
|
+
<script>
|
|
149
|
+
import { YuePageFooter } from '@yueglobal/vue-ui';
|
|
150
|
+
</script>
|
|
151
|
+
<template>
|
|
152
|
+
<yue-page-footer width="1440px" />
|
|
153
|
+
</template>
|
|
154
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
style: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
default: () => {};
|
|
5
|
+
};
|
|
6
|
+
className: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
title: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
}>, {}, {}, {}, {
|
|
15
|
+
handleClick(e: any): void;
|
|
16
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
style: {
|
|
18
|
+
type: ObjectConstructor;
|
|
19
|
+
default: () => {};
|
|
20
|
+
};
|
|
21
|
+
className: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
title: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{}>, {
|
|
30
|
+
style: Record<string, any>;
|
|
31
|
+
className: string;
|
|
32
|
+
title: string;
|
|
33
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
src: {
|
|
3
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
4
|
+
};
|
|
5
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
6
|
+
src: {
|
|
7
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
8
|
+
};
|
|
9
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
export default _default;
|
package/index.d.ts
ADDED