提交 cab81042 编写于 作者: W wanganxp

补充static目录和一些api替代方案

上级 191c5bae
......@@ -113,7 +113,7 @@ uni-app x项目manifest.json中没有提供Android权限的配置,需在此And
```
## 应用资源
## 应用资源@nativeResources
HBuilderX中对项目右键菜单 "新建" -> "目录"
![](https://native-res.dcloud.net.cn/images/uniapp/nativeresource/newdir.png)
......
......@@ -41,8 +41,8 @@
- HbuilderX 1.9.0+ 支持在根目录创建 `ext.json``sitemap.json` 等小程序需要的文件。
### static目录
为什么需要static这样的目录?
### static目录@static
- 为什么需要static这样的目录?
uni-app编译器根据pages.json扫描需要编译的页面,并根据页面引入的js、css合并打包文件。\
对于本地的图片、字体、视频、文件等资源,如果可以直接识别,那么也会把这些资源文件打包进去,但如果这些资源以变量的方式引用,
......@@ -56,4 +56,12 @@ uni-app编译器根据pages.json扫描需要编译的页面,并根据页面引
`static` 目录下的文件(vue组件、js、css 等)只有被引用时,才会被打包编译。
`css``less/scss` 等资源不要放在 `static` 目录下,建议这些公用的资源放在自建的 `common` 目录下。
\ No newline at end of file
`css``less/scss` 等资源不要放在 `static` 目录下,建议这些公用的资源放在自建的 `common` 目录下。
- static目录和App原生资源目录有关系吗?
uni-app支持App原生资源目录nativeResources,下面有assets、res等目录,[详见](app-nativeresource-android.md#nativeResources)。但和static目录没有关系。
static目录下的文件,在app第一次启动时,解压到了app的外部存储目录(external-path)。
所以注意控制static目录的大小,太大的static目录和太多文件,会造成App安装后第一次启动变慢。
\ No newline at end of file
# 其它api
插件市场还有一批可替代uni内置api的插件,比如:
插件市场和hello示例中还有一批可替代uni内置api的插件或示例代码,比如:
- [剪切板](https://ext.dcloud.net.cn/search?q=%E5%89%AA%E5%88%87%E6%9D%BF&orderBy=Relevance&cat1=8&cat2=81):uni.setClipboardData、uni.getClipboardData
- [拨打电话](https://ext.dcloud.net.cn/plugin?id=15235):uni.makePhoneCall
- [打开三方应用](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/dev/pages/template/schema/schema.uvue):打开浏览器、应用商店、地图并传参。
- [分享](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/dev/pages/template/share/share.uvue):uni.shareWithSystem
- 打开文件:uni.openDocument。[hello uts示例](](https://gitcode.net/dcloud/hello-uts/-/blob/dev/uni_modules/uts-nativepage/utssdk/app-android/index.uts))、[插件市场](https://ext.dcloud.net.cn/plugin?id=12731)
- [扫码](https://ext.dcloud.net.cn/search?q=%E6%89%AB%E7%A0%81&cat1=8&type=UpdatedDate)
- [蓝牙](https://ext.dcloud.net.cn/search?q=%E8%93%9D%E7%89%99&orderBy=Relevance&cat1=8&cat2=81)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册