jcjy-components 0.0.693 → 0.1.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/README.md +21 -25
- package/dist/components/auth-gateway/ag-input.vue.d.ts +19 -0
- package/dist/components/auth-gateway/interface.d.ts +5 -5
- package/dist/components/auth-gateway/login-form.vue.d.ts +2 -2
- package/dist/index.d.ts +4 -5
- package/dist/index.es.js +1053 -1101
- package/dist/index.umd.cjs +2 -2
- package/dist/jcjy-components.css +1 -1
- package/package.json +3 -7
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# JCJY Components
|
|
2
2
|
|
|
3
|
-
Vue 3
|
|
3
|
+
Vue 3 组件库,当前版本为纯 Vue 组件实现,不依赖 Element Plus 与 TailwindCSS。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
@@ -15,36 +15,33 @@ yarn add jcjy-components
|
|
|
15
15
|
## 依赖要求
|
|
16
16
|
|
|
17
17
|
- Vue 3.0+
|
|
18
|
-
- Element Plus 2.0+
|
|
19
|
-
|
|
20
|
-
> 说明:`jcjy-components` 已发布编译后的 CSS(含组件库样式与当前用到的 Element Plus 样式),宿主项目不强制要求安装 Tailwind。
|
|
21
18
|
|
|
22
19
|
## 使用方法
|
|
23
20
|
|
|
24
21
|
### 1. 插件方式(推荐)
|
|
25
22
|
|
|
26
23
|
```ts
|
|
27
|
-
import { createApp } from
|
|
28
|
-
import App from
|
|
29
|
-
import JcjyComponents from
|
|
30
|
-
import
|
|
31
|
-
|
|
32
|
-
const app = createApp(App)
|
|
33
|
-
app.use(JcjyComponents)
|
|
34
|
-
app.mount(
|
|
24
|
+
import { createApp } from "vue";
|
|
25
|
+
import App from "./App.vue";
|
|
26
|
+
import JcjyComponents from "jcjy-components";
|
|
27
|
+
import "jcjy-components/style.css";
|
|
28
|
+
|
|
29
|
+
const app = createApp(App);
|
|
30
|
+
app.use(JcjyComponents);
|
|
31
|
+
app.mount("#app");
|
|
35
32
|
```
|
|
36
33
|
|
|
37
34
|
### 2. 按需导入组件
|
|
38
35
|
|
|
39
36
|
```ts
|
|
40
|
-
import { AuthGateway } from
|
|
41
|
-
import
|
|
37
|
+
import { AuthGateway } from "jcjy-components";
|
|
38
|
+
import "jcjy-components/style.css";
|
|
42
39
|
|
|
43
40
|
export default {
|
|
44
41
|
components: {
|
|
45
42
|
AuthGateway,
|
|
46
43
|
},
|
|
47
|
-
}
|
|
44
|
+
};
|
|
48
45
|
```
|
|
49
46
|
|
|
50
47
|
## TypeScript 支持
|
|
@@ -52,16 +49,15 @@ export default {
|
|
|
52
49
|
本库已内置类型声明,TS 项目可直接获得类型提示。
|
|
53
50
|
|
|
54
51
|
```ts
|
|
55
|
-
import type { AuthGatewayConfig } from
|
|
52
|
+
import type { AuthGatewayConfig } from "jcjy-components/dist/components/auth-gateway/interface";
|
|
56
53
|
```
|
|
57
54
|
|
|
58
55
|
## 样式说明
|
|
59
56
|
|
|
60
57
|
- 请在宿主项目入口显式引入:`import 'jcjy-components/style.css'`
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
- 因此宿主项目的原生标签样式(如 `h1`、`p`、`button`)会保持自身样式,不会被组件库覆盖
|
|
58
|
+
- 虽然组件已脱离 TailwindCSS 与 Element Plus,但样式仍会打包到 `dist/jcjy-components.css`
|
|
59
|
+
- 因此接入方仍必须引入:`import 'jcjy-components/style.css'`
|
|
60
|
+
- 不需要额外引入第三方 UI 样式库
|
|
65
61
|
|
|
66
62
|
## 组件列表
|
|
67
63
|
|
|
@@ -84,13 +80,13 @@ import type { AuthGatewayConfig } from 'jcjy-components/dist/components/auth-gat
|
|
|
84
80
|
### 主题工具
|
|
85
81
|
|
|
86
82
|
```ts
|
|
87
|
-
import { theme } from
|
|
83
|
+
import { theme } from "jcjy-components";
|
|
88
84
|
|
|
89
85
|
// 设置主题
|
|
90
|
-
await theme.setTheme(
|
|
86
|
+
await theme.setTheme("#409EFF");
|
|
91
87
|
|
|
92
88
|
// 根据 URL 参数设置主题
|
|
93
|
-
await theme.setThemeByUrl()
|
|
89
|
+
await theme.setThemeByUrl();
|
|
94
90
|
```
|
|
95
91
|
|
|
96
92
|
## 产物说明
|
|
@@ -104,8 +100,8 @@ await theme.setThemeByUrl()
|
|
|
104
100
|
|
|
105
101
|
## 注意事项
|
|
106
102
|
|
|
107
|
-
1. 宿主项目需要自行安装 `vue
|
|
108
|
-
2.
|
|
103
|
+
1. 宿主项目需要自行安装 `vue`(peerDependencies)
|
|
104
|
+
2. 当前版本无需安装 `tailwindcss` 与 `element-plus`
|
|
109
105
|
3. 若发布到 npm,请使用:`pnpm push:npm`
|
|
110
106
|
|
|
111
107
|
## 许可证
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue: string;
|
|
3
|
+
type?: "text" | "password";
|
|
4
|
+
id?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
autocomplete?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
+
"update:modelValue": (value: string) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
type: "text" | "password";
|
|
14
|
+
id: string;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
autocomplete: string;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -39,12 +39,12 @@ export interface AuthGatewayConfig {
|
|
|
39
39
|
title?: string;
|
|
40
40
|
favicon?: string;
|
|
41
41
|
loginBackground?: string;
|
|
42
|
-
skipBind?:
|
|
43
|
-
hf?:
|
|
44
|
-
nb?:
|
|
42
|
+
skipBind?: "0" | "1";
|
|
43
|
+
hf?: "0" | "1";
|
|
44
|
+
nb?: "0" | "1";
|
|
45
45
|
cf?: string;
|
|
46
|
-
from?:
|
|
46
|
+
from?: "inline";
|
|
47
47
|
hideWx?: string;
|
|
48
|
-
layout?:
|
|
48
|
+
layout?: "default" | "center" | "left";
|
|
49
49
|
}
|
|
50
50
|
export declare const DEFAULT_CONFIG: AuthGatewayConfig;
|
|
@@ -4,11 +4,11 @@ type __VLS_Props = {
|
|
|
4
4
|
hideLoginMethods?: boolean;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
7
|
-
toggle: (v: TabKey) => any;
|
|
8
7
|
submit: (v: any) => any;
|
|
8
|
+
toggle: (v: TabKey) => any;
|
|
9
9
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
-
onToggle?: ((v: TabKey) => any) | undefined;
|
|
11
10
|
onSubmit?: ((v: any) => any) | undefined;
|
|
11
|
+
onToggle?: ((v: TabKey) => any) | undefined;
|
|
12
12
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const _default: typeof __VLS_export;
|
|
14
14
|
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { App } from
|
|
2
|
-
import AuthGateway from
|
|
3
|
-
import { setTheme, setThemeByUrl } from
|
|
4
|
-
import './styles.css';
|
|
1
|
+
import type { App } from "vue";
|
|
2
|
+
import AuthGateway from "./components/auth-gateway/index.vue";
|
|
3
|
+
import { setTheme, setThemeByUrl } from "./components/auth-gateway/util";
|
|
5
4
|
export declare const theme: {
|
|
6
5
|
setTheme: typeof setTheme;
|
|
7
6
|
setThemeByUrl: typeof setThemeByUrl;
|
|
8
7
|
};
|
|
9
8
|
export { AuthGateway };
|
|
10
|
-
export type { AuthGatewayConfig } from
|
|
9
|
+
export type { AuthGatewayConfig } from "./components/auth-gateway/interface";
|
|
11
10
|
declare const _default: {
|
|
12
11
|
install(app: App): void;
|
|
13
12
|
};
|