Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
docs: update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
ModyQyW committed Feb 9, 2023
1 parent 2ac8575 commit c345a54
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,79 @@
# 改动日志

## 0.4.0 (2023-02-09)

- feat: 提供所有组件的实例类型

之前:

```vue
<script setup lang="ts">
import { ref } from 'vue';
import type { UniBadge } from '@uni-helper/uni-app-types';
// 你必须手动构造组件实例类型
type UniBadgeInstance = InstanceOf<UniBadge>;
const uniBadgeRef = ref<UniBadgeInstance | null>();
</script>
<template>
<uni-badge ref="uniBadgeRef">uni-badge</uni-badge>
</template>
```

现在:

```vue
<script setup lang="ts">
import { ref } from 'vue';
// 你无需手动构造,导入即可使用
import type { UniBadgeInstance } from '@uni-helper/uni-app-types';
const uniBadgeRef = ref<UniBadgeInstance | null>();
// 也可以直接使用全局命名空间下的组件实例类型
// const uniBadgeRef = ref<UniHelper.UniBadgeInstance | null>();
</script>
<template>
<uni-badge ref="uniBadgeRef">uni-badge</uni-badge>
</template>
```

- feat: 现在所有组件 Props 类型下的属性都是可选的,使用 `v-bind` 直接绑定一个对象更为方便

之前:

```vue
<script setup lang="ts">
import type { UniBadgeProps } from '@uni-helper/uni-app-types';
// 你必须手动设置 Partial
// 否则你需要设置所有属性或禁用检查
const uniBadgeProps: Partial<UniBadgeProps> = { ... };
</script>
<template>
<uni-badge v-bind="uniBadgeProps">uni-badge</uni-badge>
</template>
```

现在:

```vue
<script setup lang="ts">
import type { UniBadgeProps } from '@uni-helper/uni-app-types';
// 不需要设置 Partial,也不需要设置所有属性
const uniBadgeProps: UniBadgeProps = { ... };
</script>
<template>
<uni-badge v-bind="uniBadgeProps">button</uni-badge>
</template>
```

## 0.3.3 (2023-01-31)

- fix: 修复大小写
Expand Down

1 comment on commit c345a54

@Megasu
Copy link
Member

@Megasu Megasu commented on c345a54 Mar 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greet

Please sign in to comment.