Skip to content

Commit

Permalink
docs(新增笔记): 新增uniapp相关的笔记
Browse files Browse the repository at this point in the history
  • Loading branch information
emmmmmmmm committed Sep 20, 2023
1 parent df80041 commit 3dff3cb
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/usage-frame/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
- [基础能力](docs/usage-frame/wechat-mini-program/基础能力.md)
- [自定义组件](docs/usage-frame/wechat-mini-program/自定义组件.md)
- [内置组件](docs/usage-frame/wechat-mini-program/组件.md)
- uniapp
- [速记](docs/usage-frame/uniapp/速记.md)
- react
- [基础知识](docs/usage-frame/react/react.md)
- [高级指引](docs/usage-frame/react/高级指引.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/usage-frame/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
- [基础能力](docs/usage-frame/wechat-mini-program/基础能力.md)
- [自定义组件](docs/usage-frame/wechat-mini-program/自定义组件.md)
- [内置组件](docs/usage-frame/wechat-mini-program/组件.md)
- uniapp
- [速记](docs/usage-frame/uniapp/速记.md)
- react
- [基础知识](docs/usage-frame/react/react.md)
- [高级指引](docs/usage-frame/react/高级指引.md)
Expand Down
104 changes: 104 additions & 0 deletions docs/usage-frame/uniapp/速记.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 速记

## 基础速记

- uniapp中使用js在不同版本、不同平台可能展示的效果不一样,有可能无法生效,遇到此种情况时应该查看官方文档或者搜索引擎
- 组件上的属性规范:
- `:disabled="false"`:这里引号包裹的是js表达式
- `hover-start-time=20`:这里20未被引号包裹,属于number
- 不推荐使用html标签,而是使用特定的基础组件+扩展组件(需导入)
- easycom规范:组件位于`/components|uni_modules/com-name/com-name.vue`时,就可直接在tempalte中使用

## 组件注意事项

### 内置组件

- **视图**
- view
- scroll-view:
- 避免使用map、video等原生组件
- 长列表、下拉刷新性能原因使用其他组件
- swiper、swiper-item:滑块(轮播图)
- match-media:类似媒体查询,在满足条件时展示内部内容
- movable-area、movable-view:可拖拽区块
- cover-view:主要用于展示覆盖在原生组件(如map、video、canvas等,层级高于内置组件)上的文本内容
- cover-image:主要用于覆盖在原生组件上的图片内容
- **文本**
- icon
- text
- rich-text:富文本(主要是dom树、html字符串)展示组件
- progress:进度条
- **表单**
- button
- checkbox
- radio
- input
- textarea
- editor:富文本编辑器
- label
- picker:选择器
- picker-view、picker-view-column:更灵活的选择器,嵌入页面的滚动选择器
- slider:滑块
- switch:开关
- form:表单容器
- **路由、页面跳转**
- navigator
- **媒体**
- animation-view:动画组件
- audio
- video
- camera
- image
- live-player:实时音视频播放(直播拉流)
- live-pusher:实时音视频录制(直播推流)
- **地图**
- map
- **画布**
- canvas
- **webview**
- web-view:web浏览器组件,用于装载网页
- **广告**
- **unicloud-db云数据库**
- **页面配置节点组件**
- page-meta:页面属性配置组件
- navigation-bar:页面导航条配置组件
- custom-tab-bar:自定义tabbar组件

### vue组件

- 全平台支持:template、slot
- h5支持:component、transition、transition-group、keep-alive

### nvue专有组件

- barcode:扫码
- list:高性能的列表组件
- recycle-list:具备回收复用的列表容器
- waterfall:提供瀑布流布局的核心组件
- cell:作为list、recycler、waterfall的子组件
- refresh:为容器提供下拉刷新功能,作为list、scroll-view、waterfall的子组件

### 小程序组件

- official-account:微信公众号关注组件
- open-data:展示平台提供的开放数据

### 扩展组件库

- 全端组件:uni-ui、color ui、thorui、graceui、uviewui
- only web:element、iview
- 小程序自定义组件:vant weapp、iview weapp


## web api 和JavaScript api的区别

定义:`JavaScript = ECMAScript(js语言规范) + Web APIs`

常见的web api:
- 操作文档的api:DOM(document)、BOM(window)
- 从服务器获取数据的api:XMLHttpRequest、Fetch
- 绘制和操作图形的api:canvas、webgl
- 音视频api:webrtc
- 设备api:地理定位api、系统通知api、震动硬件api
- 存储api:storage、indexeddb

Loading

0 comments on commit 3dff3cb

Please sign in to comment.