Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
unidocs-zh
提交
ce3c6c4a
unidocs-zh
项目概览
DCloud
/
unidocs-zh
通知
3598
Star
108
Fork
921
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
120
列表
看板
标记
里程碑
合并请求
109
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
120
Issue
120
列表
看板
标记
里程碑
合并请求
109
合并请求
109
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ce3c6c4a
编写于
1月 06, 2024
作者:
辛宝Otto
🥊
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'docs/merge-docs'
上级
3787f359
a2dd025b
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
932 addition
and
845 deletion
+932
-845
docs/api/base64ToArrayBuffer.md
docs/api/base64ToArrayBuffer.md
+2
-2
docs/api/location/location-change.md
docs/api/location/location-change.md
+1
-1
docs/api/media/image.md
docs/api/media/image.md
+1
-0
docs/component/editor.md
docs/component/editor.md
+41
-0
docs/component/input.md
docs/component/input.md
+1
-1
docs/component/picker.md
docs/component/picker.md
+252
-252
docs/component/uniui/uni-easyinput.md
docs/component/uniui/uni-easyinput.md
+292
-280
docs/component/uniui/uni-forms.md
docs/component/uniui/uni-forms.md
+1
-2
docs/component/uniui/uni-list.md
docs/component/uniui/uni-list.md
+1
-1
docs/component/uniui/uni-transition.md
docs/component/uniui/uni-transition.md
+162
-163
docs/component/waterfall.md
docs/component/waterfall.md
+35
-0
docs/tutorial/app-payment-stripe.md
docs/tutorial/app-payment-stripe.md
+142
-142
docs/tutorial/vue3-basics.md
docs/tutorial/vue3-basics.md
+1
-1
未找到文件。
docs/api/base64ToArrayBuffer.md
浏览文件 @
ce3c6c4a
...
...
@@ -6,7 +6,7 @@
|App|H5|微信小程序|支付宝小程序|百度小程序|抖音小程序、飞书小程序|快手小程序|京东小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|√|√|√|x|x|
x
|√|√|
|√|√|√|x|x|
√
|√|√|
**参数说明**
...
...
docs/api/location/location-change.md
浏览文件 @
ce3c6c4a
...
...
@@ -45,7 +45,7 @@ uni.onLocationChange(function (res) {
```
### uni.offLocationChange(FUNCTION CALLBACK)
关闭监听实时位置变化,前后台都停止消息接收
。
移除实时地理位置变化事件的监听函数
。
**平台差异说明**
...
...
docs/api/media/image.md
浏览文件 @
ce3c6c4a
...
...
@@ -78,6 +78,7 @@ uni.chooseImage({
|参数名|类型|必填|说明|平台差异说明|
|:-|:-|:-|:-|:-|
|current|String/Number|详见下方说明|详见下方说明||
|showmenu|Boolean|否|是否显示长按菜单,默认值为 true|微信小程序2.13.0|
|urls|Array
<
String
>
|是|需要预览的图片链接列表||
|indicator|String|否|图片指示器样式,可取值:"default" - 底部圆点指示器; "number" - 顶部数字指示器; "none" - 不显示指示器。|App|
|loop|Boolean|否|是否可循环预览,默认值为 false|App|
...
...
docs/component/editor.md
浏览文件 @
ce3c6c4a
...
...
@@ -60,6 +60,47 @@ editor组件目前只有H5、App的vue页面、微信小程序、百度小程序
| 块级样式 | `
text-align
` `
direction
` `
margin
` `
margin-top
` `
margin-left
` `
margin-right
` `
margin-bottom
` `
padding
` `
padding-top
` `
padding-left
` `
padding-right
` `
padding-bottom
` `
line-height
` `
text-indent
` |百度小程序仅支持`
text-align、direction
`|
| 行内样式 | `
font
` `
font-size
` `
font-style
` `
font-variant
` `
font-weight
` `
font-family
` `
letter-spacing
` `
text-decoration
` `
color
` `
background-color
` |百度小程序仅支持`
color、background-color
`|
## H5 使用最佳实践
近期部分用户反馈访问 `
unpkg
` 失败,导致 `
editor
` 组件初始化异常。这里提供代码块,方便用户修改。
### 方案一:自行托管 CDN 资源
分别下载[quill.min.js](https://unpkg.com/quill@1.3.7/dist/quill.min.js)、[image-resize.min.js](https://unpkg.com/quill-image-resize-mp@3.0.1/image-resize.min.js),放入 `
static
` 目录中。
在 `
index.html
`(Vue 3),或者 `
public/index.html
`(Vue2) 中在 `
head
` 之间添加 js
```html
<head>
<script src="/static/quill-1.3.7.min.js"></script>
<script src="/static/image-resize-3.0.1.min.js"></script>
</head>
```
这样 `
editor
` 组件就可以正常使用了,代码逻辑中检测到有相关 `
window.Quill
` 变量,就不会从远程获取资源。
### 方案二:从 npm 中处理资源
方案一的解决思路是在 `
window
` 上进行挂载,同样,我们可以在项目入口 `
main.js
` 或者 `
App.vue
`中引用相关依赖即可。
在项目中添加相关依赖:
```bash
npm i quill@1.3.7
```
在组件页面或者 `
main.ts
` 入口逻辑中,使用下面方案,注入依赖:
```js
// #ifdef H5
import quill from "quill";
window.Quill = quill;
// #endif
```
相比方案一,方案二好处是依赖清晰,引用透明。如果你熟悉 `
npm
` 生态和构建流程,推荐方案二。
## 注意事项
* 插入的 html 中事件绑定会被移除
...
...
docs/component/input.md
浏览文件 @
ce3c6c4a
...
...
@@ -18,7 +18,7 @@ html规范中input不仅是输入框,还有radio、checkbox、时间、日期
|disabled|Boolean|false|是否禁用||
|maxlength|Number|140|最大输入长度,设置为 -1 的时候不限制最大长度||
|cursor-spacing|Number|0|指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离|App、微信小程序、百度小程序、QQ小程序、京东小程序|
|focus|Boolean|false|获取焦点。|
在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,
需使用组件的 focus()、blur() 方法控制焦点|
|focus|Boolean|false|获取焦点。|
H5、App需要点击按钮获取焦点的,必须使用@touchend.prevent="onTap"阻止键盘收起默认事件才能获取焦点
[
关于软键盘弹出的逻辑说明
](
/component/input.html#关于软键盘弹出的逻辑说明
)
,小程序、nvue
需使用组件的 focus()、blur() 方法控制焦点|
|confirm-type|String|done|设置键盘右下角按钮的文字,仅在 type="text" 时生效。
[
有效值
](
#confirm-type
)
|微信小程序、App、H5、快手小程序、京东小程序|
|confirm-hold|Boolean|false|点击键盘右下角按钮时是否保持键盘不收起|App(3.3.7+)、H5 (3.3.7+)、微信小程序、支付宝小程序、百度小程序、QQ小程序、京东小程序|
|cursor|Number||指定focus时的光标位置||
...
...
docs/component/picker.md
浏览文件 @
ce3c6c4a
...
...
@@ -90,7 +90,7 @@
|value|String|0|表示选中的日期,格式为"YYYY-MM-DD"||
|start|String||表示有效日期范围的开始,字符串格式为"YYYY-MM-DD"||
|end|String||表示有效日期范围的结束,字符串格式为"YYYY-MM-DD"||
|fields|String|day|有效值 year、month、day,表示选择器的粒度,默认为 day,App 端未配置此项时使用系统 UI|H5、App 2.6.3+、微信小程序、
百度小程序、抖音小程序、飞书小程序|
|fields|String|day|有效值 year、month、day,表示选择器的粒度,默认为 day,App 端未配置此项时使用系统 UI|H5、App 2.6.3+、微信小程序、
支付宝小程序、百度小程序、抖音小程序、飞书小程序|
|@change|EventHandle||value 改变时触发 change 事件,event.detail = {value: value}||
|@cancel|EventHandle||取消选择时触发||
|disabled|Boolean|false|是否禁用|
|
...
...
docs/component/uniui/uni-easyinput.md
浏览文件 @
ce3c6c4a
::: tip 组件名:uni-easyinput
> 代码块: `uEasyinput`
...
...
@@ -40,6 +39,18 @@ easyinput 组件是对原生input组件的增强 ,是专门为配合表单组
<uni-easyinput
suffixIcon=
"search"
v-model=
"value"
placeholder=
"请输入内容"
@
iconClick=
"onClick"
></uni-easyinput>
```
### 插槽
设置
`right`
属性来设置右侧内容 插槽。
```
html
<uni-easyinput>
<template
#right
>
<view>
密码
</view>
</template>
</uni-easyinput>
```
### 输入框禁用
设置
`disable`
属性可以禁用输入框,此时输入框不可编辑
...
...
@@ -122,6 +133,7 @@ easyinput 组件是对原生input组件的增强 ,是专门为配合表单组
|inputBorder|Boolean|-|true|是否显示input输入框的边框|
|styles|Object|-|-| 样式自定义|
|passwordIcon|Boolean|-| true | type=password 时,是否显示小眼睛图标|
|primaryColor|String|-| #2979ff | 设置清除按钮focus时的颜色
|cursorSpacing|Number|-| 0 | 指定光标与键盘的距离,单位 px 。取 textarea/input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离。详见
[
textarea
](
https://uniapp.dcloud.net.cn/component/textarea.html
)
/
[
input
](
https://uniapp.dcloud.net.cn/component/input.html
)
|
...
...
docs/component/uniui/uni-forms.md
浏览文件 @
ce3c6c4a
::: tip 组件名:uni-forms
> 代码块: `uForms`、`uni-forms-item`
> 关联组件:`uni-forms-item`、`uni-easyinput`、`uni-data-checkbox`、`uni-group`。
...
...
@@ -113,7 +112,7 @@ uni-app的内置组件已经有了 `<form>`组件,用于提交表单内容。
::: warning 注意
-
uni-forms 1.4.0 版本后,binddata 方法不
在
推荐,请使用 uni-forms-item 上的 onFieldChange 方法代替
-
uni-forms 1.4.0 版本后,binddata 方法不
再
推荐,请使用 uni-forms-item 上的 onFieldChange 方法代替
:::
**完整示例**
...
...
docs/component/uniui/uni-list.md
浏览文件 @
ce3c6c4a
...
...
@@ -88,7 +88,7 @@ uni-list不包含下拉刷新和上拉翻页。上拉翻页另见组件:[uni-l
```
### 开启点击反馈和右侧箭头
-
设置
`clickable`
为
`true`
,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听
`click`
事件
-
设置
`clickable`
为
`true`
,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听
`click`
事件
,
`click`
事件也在此绑定
-
设置
`link`
属性,会自动开启点击反馈,并给列表右侧添加一个箭头
-
设置
`to`
属性,可以跳转页面,
`link`
的值表示跳转方式,如果不指定,默认为
`navigateTo`
...
...
docs/component/uniui/uni-transition.md
浏览文件 @
ce3c6c4a
::: tip 组件名:uni-transition
> 代码块: `uTransition`
...
...
@@ -134,12 +133,12 @@ export default {
},
methods
:
{
run
()
{
// 同时右平移到 100px,旋转 360
读
// 同时右平移到 100px,旋转 360
度
this
.
$refs
.
ani
.
step
({
translateX
:
'
100px
'
,
rotate
:
'
360
'
})
// 上面的动画执行完成后,等待200毫秒平移到 0px,旋转到 0
读
// 上面的动画执行完成后,等待200毫秒平移到 0px,旋转到 0
度
this
.
$refs
.
ani
.
step
({
translateX
:
'
0px
'
,
rotate
:
'
0
'
...
...
docs/component/waterfall.md
浏览文件 @
ce3c6c4a
...
...
@@ -64,3 +64,38 @@ app端nvue专用组件。
**注意**
-
waterfall是区域滚动,不会触发页面滚动,无法触发pages.json配置的下拉刷新、页面触底onReachBottomDistance、titleNView的transparent透明渐变。
-
如出现waterfall列表下边大面积空白区域(多列和单列时的整体高度相同,多列展示没有高度自适应),那么可以将waterfall放到父容器下边,给父容器高度设置为窗口高度,除瀑布流展示的列表外,其他的组件都放在
<header>
中即可。
示例代码如下:
```
html
<template>
<waterfall
column-count=
"2"
column-width=
"auto"
:style=
"{ height: windowHeight + 'px' }"
>
<header>
<!--轮播-->
<swiper
class=
"swiper_banner"
>
......
</swiper>
<!--广告位-->
<view
class=
"ads_List_box"
>
......
</view>
</header>
<!--瀑布流展示的商品列表-->
<cell
v-for=
"num in lists"
>
<text>
{{num}}
</text>
</cell>
</waterfall>
</template>
<script>
export
default
{
data
()
{
return
{
lists
:
[
'
A
'
,
'
B
'
,
'
C
'
,
'
D
'
,
'
E
'
],
windowHeight
:
uni
.
getSystemInfoSync
().
windowHeight
}
}
}
</script>
<style></style>
```
<img
src=
"https://ask.dcloud.net.cn/uploads/answer/20231103/7eca97560500b11a95f2014fdaea1281.png"
/>
docs/tutorial/app-payment-stripe.md
浏览文件 @
ce3c6c4a
...
...
@@ -55,7 +55,7 @@ Object对象类型
| ephemeralKey | String | 否 | Stripe的Customer Ephemeral Key,用于临时访问Customer |
| isAllowDelay | String | 否 | 是否支持延迟支付,默认不支持(将 isAllowDelay 设置为 true 后可使用一些较慢的支付方式,例如 SEPA 借记和 Sofort 对于这些支付方式,只有当 PaymentSheet 完成后才能知道最终的付款状态是成功还是失败。如果您允许这样,则通知客户您已确认他们的订单,但收到付款后才能履行(例如,发货)订单。) |
| merchantName | String | 是 | 商户名称 |
| paymentIntent | String | 是 |
Stripe的
[
PaymentIntent
](
https://stripe.com/docs/api/payment_intents
)
对象,对应服务器生成的支付订单 |
| paymentIntent | String | 是 |
对应Stripe中
[
PaymentIntent
](
https://stripe.com/docs/api/payment_intents
)
对象的client_secret,对应服务器生成的支付订单 |
| publishKey | String | 是 | 公钥,在Stripe注册账号后可获取 |
| billingDetails | Object | 否 | 银行卡账单信息(包含姓名、手机号码、邮箱地址、账单地址等)|
...
...
docs/tutorial/vue3-basics.md
浏览文件 @
ce3c6c4a
...
...
@@ -1402,7 +1402,7 @@ v-for 指令可以实现基于一个数组来渲染一个列表。
> v-model 会忽略所有表单元素的 `value`、`checked`、`selected` attribute 的初始值而总是将 Vue 实例的数据作为数据来源。你应该通过 JavaScript 在组件的 data 选项中声明初始值。
在下面的示例中,输入框通过
`v-model`
绑定了
`message`
,用户在输入框里输入内容时,这个内容会实
施
赋值给
`message`
。当然在代码里为
`message`
赋值也会实时同步到界面上input里。这就是双向绑定。
在下面的示例中,输入框通过
`v-model`
绑定了
`message`
,用户在输入框里输入内容时,这个内容会实
时
赋值给
`message`
。当然在代码里为
`message`
赋值也会实时同步到界面上input里。这就是双向绑定。
```
html
<template>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录