Skip to content

Commit

Permalink
refactor: defineOptions instead of two script (#349)
Browse files Browse the repository at this point in the history
* refactor: defineOptions instead of two script

* refactor: once more

* docs(cascader,transition): 修复 Cascader,Transition 文档示例错误 (#350)

* docs: 完善Cascader文档示例

* docs: 完善transition文档规范

---------

Co-authored-by: xujiayu <xujiayu@motern.com>

* refactor: once more

* refactor: once more

* fix: 修复comment生产环境web端卡死 (#352)

* fix: 修复comment生产环境web端卡死

* fix: 示例环境判断错误

* style: comment demo

---------

Co-authored-by: 小何同学 <59353463+xiaohe0601@users.noreply.github.com>

* refactor: once more

* docs(swiper): 完善Swiper文档示例 (#354)

* refactor: once more

* chore: disable package-manager-strict

* refactor: once more

* refactor: once more

* refactor: once more

* refactor: once more

* fix(actionsheet): 修复custom-style表现异常 (#360)

* fix(actionsheet): 修复custom-style表现异常

* refactor: once more

* refactor: once more

* docs(popup): z-index说明

* fix(popup): 修复z-index表现异常 (#364)

* chore(overlay): 修复zIndex类型错误

* docs: 更换官网域名

* docs: update changelog

* chore: release v1.7.11

* fix(input): 修复由于#324、#325引出的blur事件失效

* docs: update changelog

* chore: release v1.7.12

* chore(icon): fix scss warning

* chore(tabs): fix scss warning

* docs: 更换官网域名

* chore: fix example package eslint config

* feat(menu): add scroll-top prop (#377)

* feat(menu): add scroll-top prop

* docs(menu): add scroll-top prop

* docs: fix page scroll

* fix(navbar): 修复 navbar safe-area-inset-top 不生效的问题 (#379)

* fix(navbar): 修复 navbar safe-area-inset-top 不生效的问题

---------

Co-authored-by: 小何同学 <59353463+xiaohe0601@users.noreply.github.com>

* fix(popup,safearea): 修复部分低版本系统safearea不生效问题

* fix(input): fix @input compile error

* fix(avatar): 修复支付宝小程序不支持??语法

* fix(form): 修复支付宝小程序不支持??语法

* docs: update changelog

* chore: release v1.7.13

* feat(cell): 新增icon、clickable属性 (#384)

* feat(cell): 新增icon、clickable属性

* feat(checkbox): 新增checked-value、unchecked-value属性 (#385)

* fix(cell): fix merge error

* refactor: price、progress

* refactor: radio、radio-group

* refactor: range

* docs(overlay): 修复示例z-index表现异常

* fix(range): 修复点击控制导致NaN问题

* docs: update changelog

* chore: release v1.7.14

* fix(range): 修复可能存在flex-shrink为0时的样式异常

---------

Co-authored-by: Xu Jiayu <75623303+jynba@users.noreply.github.com>
Co-authored-by: xujiayu <xujiayu@motern.com>
Co-authored-by: yang1206 <yang1206@outlook.com.tr>
Co-authored-by: qd_whs <64092346+qd-xiaowang@users.noreply.github.com>
Co-authored-by: WilliamChan <122583055+w-WilliamChan@users.noreply.github.com>
  • Loading branch information
6 people authored Aug 5, 2024
1 parent 2f3324b commit fc023f3
Show file tree
Hide file tree
Showing 362 changed files with 5,693 additions and 5,074 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
这个表单仅用于错误报告。对于在使用中遇到的问题,请优先使用以下方式寻找解决方案:
- 查看组件文档 [nutui-uniapp](https://uniapp-nutui.tech)
- 查看组件文档 [nutui-uniapp](https://nutui-uniapp.pages.dev)
- 在 [Issue](https://github.com/nutui-uniapp/nutui-uniapp/issues) 列表中查找解决方案
- 查看 [常见问题 QA](https://github.com/nutui-uniapp/nutui-uniapp/issues/2461)
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 🤖 常见问题 QA
url: https://uniapp-nutui.tech/guide/faq.html
url: https://nutui-uniapp.pages.dev/guide/faq.html
about: 这里可能会有解决方案。
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
这个表单仅用于新功能请求。如果你有使用上的问题,或者不确定它是否是一个 bug,请先:
- 查看组件文档 [nutui-uniapp](https://uniapp-nutui.tech/)
- 查看组件文档 [nutui-uniapp](https://nutui-uniapp.pages.dev)
- 在 [Issue](https://github.com/nutui-uniapp/nutui-uniapp/issues) 列表中查找解决方案
- 查看 [常见问题 QA](https://github.com/nutui-uniapp/nutui-uniapp/issues/2461)
- type: textarea
Expand Down
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
shamefully-hoist=true
strict-peer-dependencies=false
shell-emulator=true
shell-emulator=true
package-manager-strict=false
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
## [1.7.14](https://github.com/nutui-uniapp/nutui-uniapp/compare/v1.7.13...v1.7.14) (2024-08-05)

### Bug Fixes

* **range:** 修复点击控制导致NaN问题 ([415c87c](https://github.com/nutui-uniapp/nutui-uniapp/commit/415c87c7d7738d57f4406387208875409cebfa31))

### Features

* **cell:** 新增icon、clickable属性 ([#384](https://github.com/nutui-uniapp/nutui-uniapp/issues/384)) ([3e4ff54](https://github.com/nutui-uniapp/nutui-uniapp/commit/3e4ff54ff558fbe37ace5201aa2721fbd07e659f))
* **checkbox:** 新增checked-value、unchecked-value属性 ([#385](https://github.com/nutui-uniapp/nutui-uniapp/issues/385)) ([9ef1b34](https://github.com/nutui-uniapp/nutui-uniapp/commit/9ef1b34f9ac63eb12d54cf60ac5f6ad9c6945043))

## [1.7.13](https://github.com/nutui-uniapp/nutui-uniapp/compare/v1.7.12...v1.7.13) (2024-07-30)

### Bug Fixes

* **avatar:** 修复支付宝小程序不支持??语法 ([b7df6be](https://github.com/nutui-uniapp/nutui-uniapp/commit/b7df6beddf1044a078c67681f75d7f3eb90bf4e6))
* **navbar:** 修复 navbar safe-area-inset-top 不生效的问题 ([#379](https://github.com/nutui-uniapp/nutui-uniapp/issues/379)) ([74ff480](https://github.com/nutui-uniapp/nutui-uniapp/commit/74ff480985067e7f0ebeebb74d264fe5aa3aa1d4))
* **popup,safearea:** 修复部分低版本系统safearea不生效问题 ([271e24a](https://github.com/nutui-uniapp/nutui-uniapp/commit/271e24a9b206487627bf5b59a364b306e79f50fa))

### Features

* **menu:** add scroll-top prop ([#377](https://github.com/nutui-uniapp/nutui-uniapp/issues/377)) ([7b31fdf](https://github.com/nutui-uniapp/nutui-uniapp/commit/7b31fdf9db08a0696a6ce4d6c8c52d437666aa64))

## [1.7.12](https://github.com/nutui-uniapp/nutui-uniapp/compare/v1.7.11...v1.7.12) (2024-07-09)

### Bug Fixes

* **input:** 修复由于[#324](https://github.com/nutui-uniapp/nutui-uniapp/issues/324)[#325](https://github.com/nutui-uniapp/nutui-uniapp/issues/325)引出的blur事件失效 ([afb5c76](https://github.com/nutui-uniapp/nutui-uniapp/commit/afb5c76bf10972321d79c51c7a240be5eb9559a6))

## [1.7.11](https://github.com/nutui-uniapp/nutui-uniapp/compare/v1.7.10...v1.7.11) (2024-07-08)

### Bug Fixes

* 修复comment生产环境web端卡死 ([#352](https://github.com/nutui-uniapp/nutui-uniapp/issues/352)) ([be73ccc](https://github.com/nutui-uniapp/nutui-uniapp/commit/be73cccab1afc1d4a93d8c653437bd17b7ce4a23))
* **actionsheet:** 修复custom-style表现异常 ([#360](https://github.com/nutui-uniapp/nutui-uniapp/issues/360)) ([25fc6a1](https://github.com/nutui-uniapp/nutui-uniapp/commit/25fc6a12fa943fd1b6c233dc15b529867fd03446))
* **input:** 修复小程序端clear清除困难问题 ([#324](https://github.com/nutui-uniapp/nutui-uniapp/issues/324)) ([155b00b](https://github.com/nutui-uniapp/nutui-uniapp/commit/155b00bcb3255763634a0227f197894dd2e1aae2))
* **input:** 修复由于capture引起的blur参数丢失 ([#325](https://github.com/nutui-uniapp/nutui-uniapp/issues/325)) ([a1351ad](https://github.com/nutui-uniapp/nutui-uniapp/commit/a1351addfe187914983fad1da4f9039348574eda))
* **popup:** 修复z-index表现异常 ([#364](https://github.com/nutui-uniapp/nutui-uniapp/issues/364)) ([cd50fc3](https://github.com/nutui-uniapp/nutui-uniapp/commit/cd50fc31d3b8e13771b30429de003cf6522e81ee))
* **toast:** 修复部分情况下toast的duration属性无效 ([1885ded](https://github.com/nutui-uniapp/nutui-uniapp/commit/1885ded405a0cadf00dd2adb9865c98a05f7e682))

### Features

* **menuitem:** 新增item-click事件 ([#323](https://github.com/nutui-uniapp/nutui-uniapp/issues/323)) ([df9eeed](https://github.com/nutui-uniapp/nutui-uniapp/commit/df9eeed564f89f3ed111f91f2837c0ec8b0088cc))
* **tab-pane:** 新增padding、background样式变量 ([#326](https://github.com/nutui-uniapp/nutui-uniapp/issues/326)) ([bf5ebae](https://github.com/nutui-uniapp/nutui-uniapp/commit/bf5ebae39aa9769c9c212fae0910c2e12621fdec))

## [1.7.10](https://github.com/nutui-uniapp/nutui-uniapp/compare/v1.7.9...v1.7.10) (2024-05-08)

### Bug Fixes
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ nutui-uniapp 组件库,基于Taro版[`NutUi`](https://nutui.jd.com/#/) 4.x版

## 快速上手

请参考[快速上手](https://uniapp-nutui.tech/guide/quick-start.html)
请参考[快速上手](https://nutui-uniapp.pages.dev/guide/quick-start.html)

## 链接

- [在线文档(备用地址)](https://nutui-uniapp.netlify.app)
- [意见反馈](https://github.com/nutui-uniapp/nutui-uniapp/issues)
- [更新日志](https://github.com/nutui-uniapp/nutui-uniapp/releases)
- [常见问题](https://uniapp-nutui.tech/guide/faq.html)
- [常见问题](https://nutui-uniapp.pages.dev/guide/faq.html)
- [Discussions 讨论区](https://github.com/nutui-uniapp/nutui-uniapp/discussions)

## 贡献指南
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default withPwa(defineConfig({
{ text: '组件', items: navComponents },
{
text: '示例',
link: 'https://uniapp-nutui.tech/ui',
link: 'https://nutui-uniapp.pages.dev/ui',
},
{
text: '其他',
Expand Down
188 changes: 93 additions & 95 deletions docs/components/basic/cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,76 @@
```html
<template>
<nut-cell title="我是标题" desc="描述文字"></nut-cell>
<nut-cell title="我是标题" sub-title="副标题描述" desc="描述文字"></nut-cell>
<nut-cell title="点击测试" @click="testClick"></nut-cell>

<nut-cell title="我是标题"
sub-title="副标题描述"
desc="描述文字"></nut-cell>

<!-- 自 1.7.14 开始支持 clickable 属性,可以启用点击效果 -->
<nut-cell title="点击测试"
clickable
@click="testClick"></nut-cell>

<nut-cell title="圆角设置 0" round-radius="0"></nut-cell>
</template>
<script>
import { ref } from 'vue';
export default {
setup() {
const switchChecked = ref(true);
const testClick = (event) => {
console.log('Click Test');
};
return { testClick, switchChecked };
}
};
</script>
```

### 尺寸设置 large
### large尺寸

```html
<template>
<nut-cell size="large" title="我是标题" desc="描述文字"></nut-cell>
<nut-cell size="large" title="我是标题" sub-title="副标题描述" desc="描述文字"></nut-cell>
<nut-cell size="large"
title="我是标题"
desc="描述文字"></nut-cell>

<nut-cell size="large"
title="我是标题"
sub-title="副标题描述"
desc="描述文字"></nut-cell>
</template>
```

### 直接使用插槽(slot)
### 直接使用插槽

```html
<template>
<nut-cell>
<div>自定义内容</div>
<text>自定义内容</text>
</nut-cell>
</template>
```

### 直接使用插槽(slot title)
### 标题插槽

```html
<template>
<nut-cell desc="描述文字">
<template v-slot:title>
<span>Title <b style="color: red">1</b></span>
</template>
<template #title>
<text>Title</text>
</template>
</nut-cell>
</template>
```

### 描述插槽

```html
<template>
<nut-cell title="我是标题">
<template #desc>
<text>描述文字</text>
</template>
</nut-cell>
</template>
```

### 链接 | 分组用法
### 链接 / 分组用法

```html
<template>
<nut-cell-group title="链接 | 分组用法" desc="使用 nut-cell-group 支持 title desc slots">
<nut-cell title="链接" is-link></nut-cell>
<nut-cell title="URL 跳转" desc="https://m.jd.com" is-link url="https://m.jd.com"></nut-cell>
<nut-cell title="路由跳转 ’/‘ " to="/"></nut-cell>
<nut-cell-group title="链接 / 分组用法">
<nut-cell title="链接样式" is-link></nut-cell>
<nut-cell title="路由跳转 “/” " to="/"></nut-cell>
</nut-cell-group>
</template>
```
Expand All @@ -74,80 +87,62 @@

```html
<template>
<nut-cell-group title="自定义右侧箭头区域">
<nut-cell title="Switch">
<template v-slot:link>
<nut-switch v-model="switchChecked" />
</template>
</nut-cell>
</nut-cell-group>
<nut-cell title="Switch">
<template #link>
<nut-switch></nut-switch>
</template>
</nut-cell>
</template>
<script lang="ts">
import { ref } from 'vue';
export default {
setup() {
const testClick = (event: Event) => {
console.log('点击事件');
};
const switchChecked = ref(true);
return { testClick, switchChecked };
}
};
</script>
```

### 自定义左侧 Icon 区域
### 自定义左侧图标区域

```html
<template>
<nut-cell-group title="自定义左侧 Icon 区域">
<nut-cell-group title="自定义左侧图标区域">
<nut-cell title="图片">
<template v-slot:icon>
<img
class="nut-icon"
src="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
/>
<template #icon>
<image class="nut-icon" src=""></image>
</template>
</nut-cell>
</nut-cell-group>
</template>
```

### 展示图标
> `1.7.14` 开始支持用过 `icon` 属性自定义左侧图标,之前的版本通过 `icon` 插槽修改
```html
<template>
<nut-cell title="姓名" icon="my" desc="张三"></nut-cell>
<nut-cell title="icon属性" icon="my" desc="张三"></nut-cell>

<nut-cell title="icon插槽" desc="张三">
<template #icon>
<nut-icon name="my"></nut-icon>
</template>
</nut-cell>
</template>
```

### 只展示 desc ,可通过 desc-text-align 调整内容位置
### 只展示描述

可通过 `desc-text-align` 调整内容位置

```html
<template>
<nut-cell desc-text-align="left" desc="张三"></nut-cell>
<nut-cell desc="张三" desc-text-align="left"></nut-cell>
</template>
```

### 垂直居中

通过 `center` 属性可以让 Cell 的左右内容都垂直居中
通过 `center` 属性可以让 Cell 的左右内容都垂直居中

```html
<template>
<nut-cell center title="我是标题" sub-title="副标题描述" desc="描述文字"></nut-cell>
</template>
```

### 直接使用插槽(slot desc)

```vue
<template>
<nut-cell title="我是标题">
<template #desc>
<span>描述文字 <b style="color: red">2</b></span>
</template>
</nut-cell>
<nut-cell title="我是标题"
sub-title="副标题描述"
desc="描述文字"
center></nut-cell>
</template>
```

Expand All @@ -160,43 +155,46 @@
| title | 分组标题 | string | - |
| desc | 分组描述 | string | - |

### CellGroup Slots

| 名称 | 说明 |
|---------|------------------|
| default | 自定义内容 |
| title | 自定义 `title` 标题区域 |
| desc | 自定义 `desc` 描述区域 |

### Cell Props

| 参数 | 说明 | 类型 | 默认值 |
|-----------------|------------------------------------------------------------------------------------|---------|---------|
| title | 标题名称 | string | - |
| sub-title | 左侧副标题 | string | - |
| desc | 右侧描述 | string | - |
| desc-text-align | 右侧描述文本对齐方式 [text-align](https://www.w3school.com.cn/cssref/pr_text_text-align.asp) | string | `right` |
| is-link | 是否展示右侧箭头并开启点击反馈 | boolean | `false` |
| to `1.7.8` | 跳转地址(uni.navigateTo的url参数) | string | - |
| round-radius | 圆角半径 | number | `6px` |
| center | 是否使内容垂直居中 | boolean | `false` |
| size | 单元格大小,可选值为 `large` | string | - |
| 参数 | 说明 | 类型 | 默认值 |
|--------------------|------------------------------------------------------------------------------------|------------------|---------|
| title | 标题名称 | string | - |
| sub-title | 左侧副标题 | string | - |
| desc | 右侧描述 | string | - |
| desc-text-align | 右侧描述文本对齐方式 [text-align](https://www.w3school.com.cn/cssref/pr_text_text-align.asp) | string | `right` |
| is-link | 是否展示右侧箭头并开启点击反馈 | boolean | `false` |
| to `1.7.8` | 跳转地址(uni.navigateTo的url参数) | string | - |
| round-radius | 圆角半径 | number \| string | `6px` |
| center | 是否使内容垂直居中 | boolean | `false` |
| size | 单元格大小,可选值为 `large` | string | - |
| clickable `1.7.14` | 是否启用点击效果(存在 `is-link` 或者 `to` 属性时会自动启用,也可以手动启用) | boolean | `false` |
| icon `1.7.14` | 左侧图标(对应 `nut-icon``name` 属性) | string | - |

### Cell Events

| 事件名 | 说明 | 回调参数 |
|-------|------|---------------|
| click | 点击事件 | `event:Event` |
| 事件名 | 说明 | 回调参数 |
|-------|------|----------------|
| click | 点击事件 | `event: Event` |

### Cell Slots

| 名称 | 说明 |
|--------------|------------------|
| icon | 自定义左侧 `icon` 区域 |
| default | 自定义内容 |
| link | 自定义右侧 `link` 区域 |
| title | 自定义 `title` 标题区域 |
| icon | 自定义左侧 `icon` 区域 |
| link | 自定义右侧 `link` 区域 |
| desc `1.1.6` | 自定义 `desc` 描述区域 |

### CellGroup Slots

| 名称 | 说明 |
|-------|------------------|
| title | 自定义 `title` 标题区域 |
| desc | 自定义 `desc` 描述区域 |

## 主题定制

### 样式变量
Expand Down
Loading

0 comments on commit fc023f3

Please sign in to comment.