Skip to content

Commit 67ce874

Browse files
authored
Merge pull request #1544 from DevCloudFE/dev
release v1.5.1
2 parents b8671ce + fb7284c commit 67ce874

File tree

18 files changed

+2113
-2044
lines changed

18 files changed

+2113
-2044
lines changed

.github/workflows/preview-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup Node
1515
uses: actions/setup-node@v3
1616
with:
17-
node-version: '14'
17+
node-version: '19'
1818
- name: Run Npm Scripts
1919
run: |
2020
node -v

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,17 @@ Install with pnpm
4141
pnpm add vue-devui
4242
```
4343

44-
4544
Then import `DevUI` in the `main.ts` file:
4645

4746
```ts
48-
import { createApp } from 'vue'
49-
import App from './App.vue'
47+
import { createApp } from 'vue';
48+
import App from './App.vue';
5049

5150
// Import Vue DevUI component and style
52-
import DevUI from 'vue-devui'
53-
import 'vue-devui/style.css'
51+
import DevUI from 'vue-devui';
52+
import 'vue-devui/style.css';
5453

55-
createApp(App).use(DevUI).mount('#app')
54+
createApp(App).use(DevUI).mount('#app');
5655
```
5756

5857
Then you can use the vue devui component(such as `<d-button>`) in the `App.vue` file:
@@ -119,6 +118,7 @@ Maintainers are community members who have made outstanding contributions and ha
119118
- [brenner8023](https://github.com/brenner8023)
120119

121120
Outstanding contributions include, but are not limited to, the following:
121+
122122
- 10 or more PRs are merged
123123
- Put forward more than 10 review opinions approved by PR authors
124124
- Provide constructive optimization advice and promote the project to become better
@@ -220,6 +220,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
220220
<td align="center"><a href="https://github.com/Whbbit1999"><img src="https://avatars.githubusercontent.com/u/60510247?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Whbbit1999</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=Whbbit1999" title="Code">💻</a></td>
221221
<td align="center"><a href="https://github.com/zhaoShijuan"><img src="https://avatars.githubusercontent.com/u/31791365?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zhaoShijuan</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=zhaoShijuan" title="Code">💻</a></td>
222222
<td align="center"><a href="https://github.com/XiaoRIGE"><img src="https://avatars.githubusercontent.com/u/33147011?v=4?s=100" width="100px;" alt=""/><br /><sub><b>XiaoRIGE</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=XiaoRIGE" title="Code">💻</a></td>
223+
<td align="center"><a href="https://github.com/xiaogonggong-w"><img src="https://avatars.githubusercontent.com/u/79799040?v=4" width="100px;" alt=""/><br /><sub><b>xiaogonggong-w</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=xiaogonggong-w" title="Code">💻</a></td>
224+
<td align="center"><a href="https://github.com/hqchqc"><img src="https://avatars.githubusercontent.com/u/51051157?v=4" width="100px;" alt=""/><br /><sub><b>hqchqc</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=hqchqc" title="Code">💻</a></td>
225+
<td align="center"><a href="https://github.com/Lucky-Ya-Q"><img src="https://avatars.githubusercontent.com/u/63504321?v=4" width="100px;" alt=""/><br /><sub><b>Lucky-Ya-Q</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=Lucky-Ya-Q" title="Code">💻</a></td>
223226
</tr>
224227
</tbody>
225228
</table>
@@ -233,7 +236,7 @@ This project follows the [all-contributors](https://github.com/all-contributors/
233236

234237
## Partner project
235238

236-
- [H5-Dooring - 让H5制作,更简单](http://h5.dooring.cn/)
239+
- [H5-Dooring - 让 H5 制作,更简单](http://h5.dooring.cn/)
237240
- [灯塔 - 公益性质的反霸凌团队](https://www.light-tower.top/)
238241

239242
## License

README.zh-CN.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ npm i vue-devui
3232
`main.ts`文件中引入`vue-devui`
3333

3434
```ts
35-
import { createApp } from 'vue'
36-
import App from './App.vue'
35+
import { createApp } from 'vue';
36+
import App from './App.vue';
3737

3838
// 引入 Vue DevUI 组件库及样式
39-
import DevUI from 'vue-devui'
40-
import 'vue-devui/style.css'
39+
import DevUI from 'vue-devui';
40+
import 'vue-devui/style.css';
4141

42-
createApp(App).use(DevUI).mount('#app')
42+
createApp(App).use(DevUI).mount('#app');
4343
```
4444

4545
### 3. 使用
@@ -74,6 +74,7 @@ pnpm scripts
7474
欢迎你参与到 Vue DevUI 项目的建设中来!🎉
7575

7676
通过参与 Vue DevUI 项目,我们可以一起:
77+
7778
- 🔥 学习最新的 `Vite`+`Vue3`+`TypeScript`+`JSX` 技术
7879
- 🎁 学习如何设计和开发组件
7980
- ⭐ 磨练编程技能,学习优秀的编程实践
@@ -107,6 +108,7 @@ pnpm scripts
107108
- [brenner8023](https://github.com/brenner8023)
108109

109110
杰出贡献包括但不仅限于以下行为:
111+
110112
- 合并 10 个以上 PR
111113
- 提出超过 10 条被 PR 作者认可的检视意见
112114
- 提供建设性的优化意见并推动项目变得更好
@@ -207,6 +209,10 @@ pnpm scripts
207209
<td align="center"><a href="https://github.com/hxj9102"><img src="https://avatars.githubusercontent.com/u/58357112?v=4?s=100" width="100px;" alt=""/><br /><sub><b>hxj9102</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=hxj9102" title="Code">💻</a></td>
208210
<td align="center"><a href="https://github.com/Whbbit1999"><img src="https://avatars.githubusercontent.com/u/60510247?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Whbbit1999</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=Whbbit1999" title="Code">💻</a></td>
209211
<td align="center"><a href="https://github.com/zhaoShijuan"><img src="https://avatars.githubusercontent.com/u/31791365?v=4?s=100" width="100px;" alt=""/><br /><sub><b>zhaoShijuan</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=zhaoShijuan" title="Code">💻</a></td>
212+
<td align="center"><a href="https://github.com/XiaoRIGE"><img src="https://avatars.githubusercontent.com/u/33147011?v=4?s=100" width="100px;" alt=""/><br /><sub><b>XiaoRIGE</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=XiaoRIGE" title="Code">💻</a></td>
213+
<td align="center"><a href="https://github.com/xiaogonggong-w"><img src="https://avatars.githubusercontent.com/u/79799040?v=4" width="100px;" alt=""/><br /><sub><b>xiaogonggong-w</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=xiaogonggong-w" title="Code">💻</a></td>
214+
<td align="center"><a href="https://github.com/hqchqc"><img src="https://avatars.githubusercontent.com/u/51051157?v=4" width="100px;" alt=""/><br /><sub><b>hqchqc</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=hqchqc" title="Code">💻</a></td>
215+
<td align="center"><a href="https://github.com/Lucky-Ya-Q"><img src="https://avatars.githubusercontent.com/u/63504321?v=4" width="100px;" alt=""/><br /><sub><b>Lucky-Ya-Q</b></sub></a><br /><a href="https://github.com/DevCloudFE/vue-devui/commits?author=Lucky-Ya-Q" title="Code">💻</a></td>
210216
</tr>
211217
</tbody>
212218
</table>
@@ -220,7 +226,7 @@ pnpm scripts
220226

221227
## 合作项目
222228

223-
- [H5-Dooring - 让H5制作,更简单](http://h5.dooring.cn/)
229+
- [H5-Dooring - 让 H5 制作,更简单](http://h5.dooring.cn/)
224230
- [灯塔 - 公益性质的反霸凌团队](https://www.light-tower.top/)
225231

226232
## 开源许可

packages/devui-vue/devui/image-preview/src/transform.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ export default class Transform {
122122
reset(): void {
123123
this.transformX = this.TRANSFORMX;
124124
this.transformY = this.TRANSFORMY;
125+
this.oTransformX = this.transformX;
126+
this.oTransformY = this.transformY;
125127
this.zoom = this.ZOOM;
126128
}
127129
setPosition(): void {

packages/devui-vue/devui/menu/src/components/menu-item/menu-item.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export default defineComponent({
2727
const multiple = inject('multiple') as boolean;
2828
const indent = inject('defaultIndent');
2929
const isCollapsed = inject('isCollapsed') as Ref<boolean>;
30-
const defaultSelectKey = inject('defaultSelectKey') as string[];
30+
const defaultSelectKey = inject('defaultSelectKey') as Ref<string[]>;
3131
const { disabled } = toRefs(props);
32-
const isSelect = ref(initSelect(defaultSelectKey, key, multiple, disabled));
32+
const isSelect = ref(initSelect(defaultSelectKey.value, key, multiple, disabled));
3333
const isLayer1 = ref(true);
3434
const rootMenuEmit = inject('rootMenuEmit') as (eventName: string, ...args: unknown[]) => void;
3535
const useRouter = inject('useRouter') as boolean;
@@ -90,7 +90,7 @@ export default defineComponent({
9090
}
9191
});
9292
watch(
93-
() => defaultSelectKey,
93+
()=>[...defaultSelectKey.value],
9494
(n) => {
9595
isSelect.value = initSelect(n, key, multiple, disabled);
9696
classObject.value[menuItemSelect] = isSelect.value;

packages/devui-vue/devui/menu/src/composables/use-click.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface clickEvent extends MouseEvent {
77
}
88

99
export function useClick(e: clickEvent): void {
10-
const paths = e.path;
10+
const paths = e.composedPath() as HTMLElement[];
1111
for (let i = 0; i < paths.length; i++) {
1212
const path = paths[i];
1313
if (path.classList.contains(`${ns.b()}-horizontal`)) {

packages/devui-vue/devui/menu/src/composables/use-layer-operate.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ function getRoot(path: HTMLElement[]): HTMLElement {
9898
function clearSelect_isHorizontal(ele: HTMLElement, event: clickEvent) {
9999
let element = event.target as HTMLElement;
100100
let stack: Element[] = [];
101-
const { path } = event;
102-
const root = getRoot(path as HTMLElement[]);
101+
const root = getRoot(event.composedPath() as HTMLElement[]);
103102
stack = [...Array.from(root.children)] as HTMLElement[];
104103
if (element.tagName === 'SPAN') {
105104
element = element.parentElement as HTMLElement;

packages/devui-vue/devui/menu/src/menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default defineComponent({
1515
emits: ['select', 'deselect', 'submenu-change'],
1616
setup(props: MenuProps, ctx) {
1717
const ns = useNamespace('menu');
18-
const {openKeys, mode, collapsed} = toRefs(props);
18+
const {openKeys, mode, collapsed, defaultSelectKeys} = toRefs(props);
1919
// This ID is only for internal use. So we unwanted use reactivity
2020
const menuId = randomId(16);
2121
// register menu to recordTable.
@@ -25,7 +25,7 @@ export default defineComponent({
2525
provide('defaultIndent', props['indentSize']);
2626
provide('multiple', props['multiple']);
2727
provide('openKeys', openKeys);
28-
provide('defaultSelectKey', props.defaultSelectKeys);
28+
provide('defaultSelectKey', defaultSelectKeys);
2929
provide('mode', mode);
3030
provide('collapsedIndent', props['collapsedIndent']);
3131
provide('rootMenuEmit', ctx.emit);

packages/devui-vue/devui/tag/src/tag.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, toRefs, watch, onUnmounted } from 'vue';
1+
import { defineComponent, toRefs, watch, onUnmounted, computed } from 'vue';
22
import { tagProps, TagProps } from './tag-types';
33
import { useClass, useColor } from './composables';
44
import { useNamespace } from '../../shared/hooks/use-namespace';
@@ -23,17 +23,23 @@ export default defineComponent({
2323
e.stopPropagation();
2424
emit('tagDelete', e);
2525
};
26+
27+
// 计算内容的颜色
28+
const contentColor = computed(() => {
29+
return isDefaultTag() ? '' : checked.value ? '#fff' : themeColor.value;
30+
});
31+
32+
// 关闭icon
2633
const closeIconEl = () => {
34+
const iconName = isDefaultTag() ? 'error-o' : 'close';
35+
2736
return deletable.value ? (
2837
<a class="remove-button" onClick={handleDelete}>
29-
{isDefaultTag() ? (
30-
<d-icon size="12px" name="error-o" color="#adb0b8" />
31-
) : (
32-
<d-icon size="12px" name="close" color={themeColor.value} />
33-
)}
38+
<d-icon size="12px" name={iconName} color={contentColor.value} />
3439
</a>
3540
) : null;
3641
};
42+
3743
const unWatch = watch(checked, (newVal) => {
3844
emit('checkedChange', newVal);
3945
});
@@ -45,7 +51,7 @@ export default defineComponent({
4551
class={tagClass.value}
4652
style={{
4753
display: 'block',
48-
color: checked.value ? '#fff' : themeColor.value,
54+
color: contentColor.value,
4955
backgroundColor: checked.value ? themeColor.value : !color.value ? '' : 'var(--devui-base-bg, #ffffff)',
5056
}}
5157
title={tagTitle}>

packages/devui-vue/docs/.vitepress/config/lang.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ const lang = {
22
'/': {
33
'hide-text': '隐藏代码',
44
'show-text': '显示代码',
5-
'copy-button-text': '复制代码片段'
5+
'copy-button-text': '复制代码片段',
6+
'copy-success-text': '复制成功',
67
},
78
'/en-US': {
89
'hide-text': 'Hide',
910
'show-text': 'Expand',
10-
'copy-button-text': 'Copy'
11-
}
12-
}
11+
'copy-button-text': 'Copy',
12+
'copy-success-text': 'Copy Success',
13+
},
14+
};
1315

14-
export default lang
16+
export default lang;

0 commit comments

Comments
 (0)