jcjy-components 0.0.694 → 0.1.1
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 -29
- 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 +1060 -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,39 +15,33 @@ yarn add jcjy-components
|
|
|
15
15
|
## 依赖要求
|
|
16
16
|
|
|
17
17
|
- Vue 3.0+
|
|
18
|
-
- Element Plus 2.0+
|
|
19
|
-
- TailwindCSS 3.x(仅支持 TailwindCSS 项目)
|
|
20
|
-
|
|
21
|
-
> 说明:当前版本仅支持已集成 TailwindCSS 的宿主项目;第三方接入时需额外引入 Element Plus 全量样式。
|
|
22
18
|
|
|
23
19
|
## 使用方法
|
|
24
20
|
|
|
25
21
|
### 1. 插件方式(推荐)
|
|
26
22
|
|
|
27
23
|
```ts
|
|
28
|
-
import { createApp } from
|
|
29
|
-
import App from
|
|
30
|
-
import JcjyComponents from
|
|
31
|
-
import
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
app.
|
|
36
|
-
app.mount('#app')
|
|
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");
|
|
37
32
|
```
|
|
38
33
|
|
|
39
34
|
### 2. 按需导入组件
|
|
40
35
|
|
|
41
36
|
```ts
|
|
42
|
-
import { AuthGateway } from
|
|
43
|
-
import
|
|
44
|
-
import 'jcjy-components/style.css'
|
|
37
|
+
import { AuthGateway } from "jcjy-components";
|
|
38
|
+
import "jcjy-components/style.css";
|
|
45
39
|
|
|
46
40
|
export default {
|
|
47
41
|
components: {
|
|
48
42
|
AuthGateway,
|
|
49
43
|
},
|
|
50
|
-
}
|
|
44
|
+
};
|
|
51
45
|
```
|
|
52
46
|
|
|
53
47
|
## TypeScript 支持
|
|
@@ -55,17 +49,15 @@ export default {
|
|
|
55
49
|
本库已内置类型声明,TS 项目可直接获得类型提示。
|
|
56
50
|
|
|
57
51
|
```ts
|
|
58
|
-
import type { AuthGatewayConfig } from
|
|
52
|
+
import type { AuthGatewayConfig } from "jcjy-components/dist/components/auth-gateway/interface";
|
|
59
53
|
```
|
|
60
54
|
|
|
61
55
|
## 样式说明
|
|
62
56
|
|
|
63
57
|
- 请在宿主项目入口显式引入:`import 'jcjy-components/style.css'`
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- 组件库已关闭 Tailwind 的 `@tailwind base` 与 `@tailwind components`,仅保留 utilities,避免把全局 reset 样式注入到宿主项目
|
|
68
|
-
- 因此宿主项目的原生标签样式(如 `h1`、`p`、`button`)会保持自身样式,不会被组件库覆盖
|
|
58
|
+
- 虽然组件已脱离 TailwindCSS 与 Element Plus,但样式仍会打包到 `dist/jcjy-components.css`
|
|
59
|
+
- 因此接入方仍必须引入:`import 'jcjy-components/style.css'`
|
|
60
|
+
- 不需要额外引入第三方 UI 样式库
|
|
69
61
|
|
|
70
62
|
## 组件列表
|
|
71
63
|
|
|
@@ -88,13 +80,13 @@ import type { AuthGatewayConfig } from 'jcjy-components/dist/components/auth-gat
|
|
|
88
80
|
### 主题工具
|
|
89
81
|
|
|
90
82
|
```ts
|
|
91
|
-
import { theme } from
|
|
83
|
+
import { theme } from "jcjy-components";
|
|
92
84
|
|
|
93
85
|
// 设置主题
|
|
94
|
-
await theme.setTheme(
|
|
86
|
+
await theme.setTheme("#409EFF");
|
|
95
87
|
|
|
96
88
|
// 根据 URL 参数设置主题
|
|
97
|
-
await theme.setThemeByUrl()
|
|
89
|
+
await theme.setThemeByUrl();
|
|
98
90
|
```
|
|
99
91
|
|
|
100
92
|
## 产物说明
|
|
@@ -108,8 +100,8 @@ await theme.setThemeByUrl()
|
|
|
108
100
|
|
|
109
101
|
## 注意事项
|
|
110
102
|
|
|
111
|
-
1. 宿主项目需要自行安装 `vue
|
|
112
|
-
2.
|
|
103
|
+
1. 宿主项目需要自行安装 `vue`(peerDependencies)
|
|
104
|
+
2. 当前版本无需安装 `tailwindcss` 与 `element-plus`
|
|
113
105
|
3. 若发布到 npm,请使用:`pnpm push:npm`
|
|
114
106
|
|
|
115
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
|
};
|