@nhdropshipping/y-components 1.0.2 → 1.0.4
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 +154 -154
- package/dist/components/ypagination.vue.d.ts.map +1 -1
- package/dist/components/ytable.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1177 -1171
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +45 -45
package/README.md
CHANGED
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
# @nhdropshipping/y-components
|
|
2
|
-
|
|
3
|
-
Vue 3 组件库,包含常用的 UI 组件。
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @nhdropshipping/y-components
|
|
9
|
-
# 或
|
|
10
|
-
yarn add @nhdropshipping/y-components
|
|
11
|
-
# 或
|
|
12
|
-
pnpm add @nhdropshipping/y-components
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## 使用
|
|
16
|
-
|
|
17
|
-
### ⚠️ 重要提示
|
|
18
|
-
|
|
19
|
-
**使用组件库前,必须先引入样式文件!**
|
|
20
|
-
|
|
21
|
-
```typescript
|
|
22
|
-
import '@nhdropshipping/y-components/dist/style.css'
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### 全量引入
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
import { createApp } from 'vue'
|
|
29
|
-
import YComponents from '@nhdropshipping/y-components'
|
|
30
|
-
import '@nhdropshipping/y-components/dist/style.css' // ⚠️ 必须引入样式文件
|
|
31
|
-
|
|
32
|
-
const app = createApp(App)
|
|
33
|
-
app.use(YComponents)
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### 按需引入
|
|
37
|
-
|
|
38
|
-
```vue
|
|
39
|
-
<template>
|
|
40
|
-
<YButton variant="primary" size="medium">点击我</YButton>
|
|
41
|
-
<YInput v-model="inputValue" placeholder="请输入" />
|
|
42
|
-
</template>
|
|
43
|
-
|
|
44
|
-
<script setup lang="ts">
|
|
45
|
-
import { YButton, YInput } from '@nhdropshipping/y-components'
|
|
46
|
-
import '@nhdropshipping/y-components/dist/style.css' // ⚠️ 必须引入样式文件
|
|
47
|
-
import { ref } from 'vue'
|
|
48
|
-
|
|
49
|
-
const inputValue = ref('')
|
|
50
|
-
</script>
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### 使用 YMessage
|
|
54
|
-
|
|
55
|
-
YMessage 支持两种使用方式:
|
|
56
|
-
|
|
57
|
-
**方式一:直接导入使用**
|
|
58
|
-
```typescript
|
|
59
|
-
import { YMessage } from '@nhdropshipping/y-components'
|
|
60
|
-
|
|
61
|
-
// 成功提示
|
|
62
|
-
YMessage.success('操作成功')
|
|
63
|
-
|
|
64
|
-
// 警告提示
|
|
65
|
-
YMessage.warning('请注意')
|
|
66
|
-
|
|
67
|
-
// 错误提示
|
|
68
|
-
YMessage.error('操作失败')
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
**方式二:全局使用(无需 import)**
|
|
72
|
-
|
|
73
|
-
使用 `Vue.use()` 后,`YMessage` 会自动挂载到全局,可以直接使用:
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
// main.ts
|
|
77
|
-
import { createApp } from 'vue'
|
|
78
|
-
import YComponents from '@nhdropshipping/y-components'
|
|
79
|
-
import '@nhdropshipping/y-components/dist/style.css' // ⚠️ 必须引入样式文件
|
|
80
|
-
|
|
81
|
-
const app = createApp(App)
|
|
82
|
-
app.use(YComponents) // 挂载后,YMessage 自动可用
|
|
83
|
-
|
|
84
|
-
// 在任何组件或文件中直接使用(无需 import)
|
|
85
|
-
YMessage.success('操作成功!')
|
|
86
|
-
YMessage.warning('请注意')
|
|
87
|
-
YMessage.error('操作失败')
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
```vue
|
|
91
|
-
<template>
|
|
92
|
-
<button @click="handleClick">点击我</button>
|
|
93
|
-
</template>
|
|
94
|
-
|
|
95
|
-
<script setup lang="ts">
|
|
96
|
-
// 无需 import YMessage,直接使用
|
|
97
|
-
function handleClick() {
|
|
98
|
-
YMessage.success('操作成功!')
|
|
99
|
-
}
|
|
100
|
-
</script>
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**带选项的调用:**
|
|
104
|
-
```typescript
|
|
105
|
-
YMessage.success('操作成功', {
|
|
106
|
-
duration: 3000, // 3秒后自动关闭
|
|
107
|
-
closable: true // 显示关闭按钮
|
|
108
|
-
})
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## 组件列表
|
|
112
|
-
|
|
113
|
-
- **YButton** - 按钮组件
|
|
114
|
-
- **YInput** - 输入框组件
|
|
115
|
-
- **YSelect** - 选择器组件
|
|
116
|
-
- **YTable** - 表格组件
|
|
117
|
-
- **YPagination** - 分页组件
|
|
118
|
-
- **YBadge** - 徽章组件
|
|
119
|
-
- **YDialog** - 对话框组件
|
|
120
|
-
- **YDrawer** - 抽屉组件
|
|
121
|
-
- **YPopover** - 弹出框组件
|
|
122
|
-
- **YSwitch** - 开关组件
|
|
123
|
-
- **YImage** - 图片组件
|
|
124
|
-
- **YDropdown** - 下拉菜单组件
|
|
125
|
-
- **YTree** - 树形组件
|
|
126
|
-
- **YTime** - 时间选择器组件
|
|
127
|
-
- **QueryEncapsulation** - 查询封装组件
|
|
128
|
-
- **YMessage** - 消息提示(函数式调用)
|
|
129
|
-
|
|
130
|
-
## 开发
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
# 安装依赖
|
|
134
|
-
npm install
|
|
135
|
-
|
|
136
|
-
# 构建
|
|
137
|
-
npm run build
|
|
138
|
-
|
|
139
|
-
# 开发模式(监听模式)
|
|
140
|
-
npm run dev
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## 发布
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
# 构建后发布
|
|
147
|
-
npm run build
|
|
148
|
-
npm publish
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## License
|
|
152
|
-
|
|
153
|
-
MIT
|
|
154
|
-
|
|
1
|
+
# @nhdropshipping/y-components
|
|
2
|
+
|
|
3
|
+
Vue 3 组件库,包含常用的 UI 组件。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @nhdropshipping/y-components
|
|
9
|
+
# 或
|
|
10
|
+
yarn add @nhdropshipping/y-components
|
|
11
|
+
# 或
|
|
12
|
+
pnpm add @nhdropshipping/y-components
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 使用
|
|
16
|
+
|
|
17
|
+
### ⚠️ 重要提示
|
|
18
|
+
|
|
19
|
+
**使用组件库前,必须先引入样式文件!**
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import '@nhdropshipping/y-components/dist/style.css'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 全量引入
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { createApp } from 'vue'
|
|
29
|
+
import YComponents from '@nhdropshipping/y-components'
|
|
30
|
+
import '@nhdropshipping/y-components/dist/style.css' // ⚠️ 必须引入样式文件
|
|
31
|
+
|
|
32
|
+
const app = createApp(App)
|
|
33
|
+
app.use(YComponents)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 按需引入
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<template>
|
|
40
|
+
<YButton variant="primary" size="medium">点击我</YButton>
|
|
41
|
+
<YInput v-model="inputValue" placeholder="请输入" />
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
import { YButton, YInput } from '@nhdropshipping/y-components'
|
|
46
|
+
import '@nhdropshipping/y-components/dist/style.css' // ⚠️ 必须引入样式文件
|
|
47
|
+
import { ref } from 'vue'
|
|
48
|
+
|
|
49
|
+
const inputValue = ref('')
|
|
50
|
+
</script>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 使用 YMessage
|
|
54
|
+
|
|
55
|
+
YMessage 支持两种使用方式:
|
|
56
|
+
|
|
57
|
+
**方式一:直接导入使用**
|
|
58
|
+
```typescript
|
|
59
|
+
import { YMessage } from '@nhdropshipping/y-components'
|
|
60
|
+
|
|
61
|
+
// 成功提示
|
|
62
|
+
YMessage.success('操作成功')
|
|
63
|
+
|
|
64
|
+
// 警告提示
|
|
65
|
+
YMessage.warning('请注意')
|
|
66
|
+
|
|
67
|
+
// 错误提示
|
|
68
|
+
YMessage.error('操作失败')
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**方式二:全局使用(无需 import)**
|
|
72
|
+
|
|
73
|
+
使用 `Vue.use()` 后,`YMessage` 会自动挂载到全局,可以直接使用:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
// main.ts
|
|
77
|
+
import { createApp } from 'vue'
|
|
78
|
+
import YComponents from '@nhdropshipping/y-components'
|
|
79
|
+
import '@nhdropshipping/y-components/dist/style.css' // ⚠️ 必须引入样式文件
|
|
80
|
+
|
|
81
|
+
const app = createApp(App)
|
|
82
|
+
app.use(YComponents) // 挂载后,YMessage 自动可用
|
|
83
|
+
|
|
84
|
+
// 在任何组件或文件中直接使用(无需 import)
|
|
85
|
+
YMessage.success('操作成功!')
|
|
86
|
+
YMessage.warning('请注意')
|
|
87
|
+
YMessage.error('操作失败')
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```vue
|
|
91
|
+
<template>
|
|
92
|
+
<button @click="handleClick">点击我</button>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<script setup lang="ts">
|
|
96
|
+
// 无需 import YMessage,直接使用
|
|
97
|
+
function handleClick() {
|
|
98
|
+
YMessage.success('操作成功!')
|
|
99
|
+
}
|
|
100
|
+
</script>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**带选项的调用:**
|
|
104
|
+
```typescript
|
|
105
|
+
YMessage.success('操作成功', {
|
|
106
|
+
duration: 3000, // 3秒后自动关闭
|
|
107
|
+
closable: true // 显示关闭按钮
|
|
108
|
+
})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 组件列表
|
|
112
|
+
|
|
113
|
+
- **YButton** - 按钮组件
|
|
114
|
+
- **YInput** - 输入框组件
|
|
115
|
+
- **YSelect** - 选择器组件
|
|
116
|
+
- **YTable** - 表格组件
|
|
117
|
+
- **YPagination** - 分页组件
|
|
118
|
+
- **YBadge** - 徽章组件
|
|
119
|
+
- **YDialog** - 对话框组件
|
|
120
|
+
- **YDrawer** - 抽屉组件
|
|
121
|
+
- **YPopover** - 弹出框组件
|
|
122
|
+
- **YSwitch** - 开关组件
|
|
123
|
+
- **YImage** - 图片组件
|
|
124
|
+
- **YDropdown** - 下拉菜单组件
|
|
125
|
+
- **YTree** - 树形组件
|
|
126
|
+
- **YTime** - 时间选择器组件
|
|
127
|
+
- **QueryEncapsulation** - 查询封装组件
|
|
128
|
+
- **YMessage** - 消息提示(函数式调用)
|
|
129
|
+
|
|
130
|
+
## 开发
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# 安装依赖
|
|
134
|
+
npm install
|
|
135
|
+
|
|
136
|
+
# 构建
|
|
137
|
+
npm run build
|
|
138
|
+
|
|
139
|
+
# 开发模式(监听模式)
|
|
140
|
+
npm run dev
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## 发布
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# 构建后发布
|
|
147
|
+
npm run build
|
|
148
|
+
npm publish
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT
|
|
154
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ypagination.vue.d.ts","sourceRoot":"","sources":["../../src/components/ypagination.vue"],"names":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CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ytable.vue.d.ts","sourceRoot":"","sources":["../../src/components/ytable.vue"],"names":[],"mappings":"AAoHA;
|
|
1
|
+
{"version":3,"file":"ytable.vue.d.ts","sourceRoot":"","sources":["../../src/components/ytable.vue"],"names":[],"mappings":"AAoHA;AAIA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,MAAM,CAAA;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACzD,MAAM,CAAC,EAAE,MAAM,GAAG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