simple-web-lib 0.0.4 → 0.0.5
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 +71 -71
- package/lib/components/simple-button/index.d.ts +8 -0
- package/lib/components/simple-button/src/SimpleButton.vue.d.ts +2 -0
- package/lib/components/simple-card/index.d.ts +8 -0
- package/lib/components/simple-card/src/SimpleCard.vue.d.ts +9 -0
- package/lib/index.d.ts +12 -0
- package/lib/locales/index.d.ts +20 -0
- package/lib/simple-web-lib.es.js +1458 -1549
- package/lib/simple-web-lib.umd.js +18 -18
- package/lib/style.css +1 -1
- package/package.json +58 -55
package/README.md
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
# Simple Web Library
|
|
2
|
-
|
|
3
|
-
一个简单的组件库示例,用于演示如何构建一个具有国际化支持的 Vue 3 组件库,并使用 VitePress 编写文档。
|
|
4
|
-
|
|
5
|
-
## 特性
|
|
6
|
-
|
|
7
|
-
- **Vue 3 支持**: 使用 Composition API 和最新的 Vue 3 特性
|
|
8
|
-
- **国际化**: 基于 vue-i18n 的完整国际化支持
|
|
9
|
-
- **VitePress 文档**: 使用 VitePress 构建美观的文档站点
|
|
10
|
-
- **TypeScript**: 完整的 TypeScript 支持
|
|
11
|
-
- **按需加载**: 支持按需加载组件
|
|
12
|
-
|
|
13
|
-
## 安装
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install simple-web-lib
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## 使用
|
|
20
|
-
|
|
21
|
-
### 完整引入
|
|
22
|
-
|
|
23
|
-
```javascript
|
|
24
|
-
import { createApp } from 'vue'
|
|
25
|
-
import SimpleWebLib from 'simple-web-lib'
|
|
26
|
-
import 'simple-web-lib/dist/style.css'
|
|
27
|
-
|
|
28
|
-
import App from './App.vue'
|
|
29
|
-
|
|
30
|
-
const app = createApp(App)
|
|
31
|
-
|
|
32
|
-
app.use(SimpleWebLib)
|
|
33
|
-
app.mount('#app')
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### 按需引入
|
|
37
|
-
|
|
38
|
-
```javascript
|
|
39
|
-
import { createApp } from 'vue'
|
|
40
|
-
import { SimpleButton, SimpleCard } from 'simple-web-lib'
|
|
41
|
-
import 'simple-web-lib/dist/style.css'
|
|
42
|
-
|
|
43
|
-
import App from './App.vue'
|
|
44
|
-
|
|
45
|
-
const app = createApp(App)
|
|
46
|
-
|
|
47
|
-
// 分别安装组件
|
|
48
|
-
app.use(SimpleButton)
|
|
49
|
-
app.use(SimpleCard)
|
|
50
|
-
|
|
51
|
-
app.mount('#app')
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## 开发
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
# 安装依赖
|
|
58
|
-
npm install
|
|
59
|
-
|
|
60
|
-
# 启动文档站点
|
|
61
|
-
npm run docs:dev
|
|
62
|
-
|
|
63
|
-
# 构建文档
|
|
64
|
-
npm run docs:build
|
|
65
|
-
|
|
66
|
-
# 构建组件库
|
|
67
|
-
npm run lib:build
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## 许可证
|
|
71
|
-
|
|
1
|
+
# Simple Web Library
|
|
2
|
+
|
|
3
|
+
一个简单的组件库示例,用于演示如何构建一个具有国际化支持的 Vue 3 组件库,并使用 VitePress 编写文档。
|
|
4
|
+
|
|
5
|
+
## 特性
|
|
6
|
+
|
|
7
|
+
- **Vue 3 支持**: 使用 Composition API 和最新的 Vue 3 特性
|
|
8
|
+
- **国际化**: 基于 vue-i18n 的完整国际化支持
|
|
9
|
+
- **VitePress 文档**: 使用 VitePress 构建美观的文档站点
|
|
10
|
+
- **TypeScript**: 完整的 TypeScript 支持
|
|
11
|
+
- **按需加载**: 支持按需加载组件
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install simple-web-lib
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 使用
|
|
20
|
+
|
|
21
|
+
### 完整引入
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
import { createApp } from 'vue'
|
|
25
|
+
import SimpleWebLib from 'simple-web-lib'
|
|
26
|
+
import 'simple-web-lib/dist/style.css'
|
|
27
|
+
|
|
28
|
+
import App from './App.vue'
|
|
29
|
+
|
|
30
|
+
const app = createApp(App)
|
|
31
|
+
|
|
32
|
+
app.use(SimpleWebLib)
|
|
33
|
+
app.mount('#app')
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 按需引入
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
import { createApp } from 'vue'
|
|
40
|
+
import { SimpleButton, SimpleCard } from 'simple-web-lib'
|
|
41
|
+
import 'simple-web-lib/dist/style.css'
|
|
42
|
+
|
|
43
|
+
import App from './App.vue'
|
|
44
|
+
|
|
45
|
+
const app = createApp(App)
|
|
46
|
+
|
|
47
|
+
// 分别安装组件
|
|
48
|
+
app.use(SimpleButton)
|
|
49
|
+
app.use(SimpleCard)
|
|
50
|
+
|
|
51
|
+
app.mount('#app')
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 开发
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# 安装依赖
|
|
58
|
+
npm install
|
|
59
|
+
|
|
60
|
+
# 启动文档站点
|
|
61
|
+
npm run docs:dev
|
|
62
|
+
|
|
63
|
+
# 构建文档
|
|
64
|
+
npm run docs:build
|
|
65
|
+
|
|
66
|
+
# 构建组件库
|
|
67
|
+
npm run lib:build
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 许可证
|
|
71
|
+
|
|
72
72
|
MIT
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
2
|
+
default?(_: {}): any;
|
|
3
|
+
}>;
|
|
4
|
+
export default _default;
|
|
5
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
|
+
new (): {
|
|
7
|
+
$slots: S;
|
|
8
|
+
};
|
|
9
|
+
};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import SimpleButton from './components/simple-button';
|
|
3
|
+
import SimpleCard from './components/simple-card';
|
|
4
|
+
import { I18n } from 'vue-i18n';
|
|
5
|
+
export type { I18n };
|
|
6
|
+
export type Language = 'zh_CN' | 'en_US';
|
|
7
|
+
declare const install: (app: App) => void;
|
|
8
|
+
export { install, SimpleButton, SimpleCard };
|
|
9
|
+
declare const _default: {
|
|
10
|
+
install: (app: App<any>) => void;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const zhCN: {
|
|
2
|
+
simpleButton: {
|
|
3
|
+
clickMe: string;
|
|
4
|
+
clicked: string;
|
|
5
|
+
};
|
|
6
|
+
simpleCard: {
|
|
7
|
+
title: string;
|
|
8
|
+
content: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const enUS: {
|
|
12
|
+
simpleButton: {
|
|
13
|
+
clickMe: string;
|
|
14
|
+
clicked: string;
|
|
15
|
+
};
|
|
16
|
+
simpleCard: {
|
|
17
|
+
title: string;
|
|
18
|
+
content: string;
|
|
19
|
+
};
|
|
20
|
+
};
|