提交 030e8dd7 编写于 作者: M mahaifeng

[file-env]添加uni-env示例

上级 a71e74f4
......@@ -458,6 +458,13 @@
"navigationBarTitleText": "文件管理"
}
},
{
"path" : "pages/API/get-file-uni-env/get-file-uni-env",
"style" :
{
"navigationBarTitleText" : "file-uni-env"
}
},
// #endif
{
"path": "pages/API/action-sheet/action-sheet",
......
<template>
<!-- #ifdef APP -->
<text>操作日志</text><button size="mini" @click="log=''">清空日志</button>
<text style="margin: 2px; padding: 2px; border: 1px solid #000000;">{{ log }}</text>
<scroll-view style="flex: 1;">
<!-- #endif -->
<!-- #ifdef APP -->
<button class="btnstyle" type="primary" @tap="geAbsPath(sandboxPath)" id="btn-path">应用外置沙盒目录uni.env.SANDBOX_PATH</button>
<button class="btnstyle" type="primary" @tap="geAbsPath(cachePath)" id="btn-path">缓存文件目录uni.env.CACHE_PATH</button>
<button class="btnstyle" type="primary" @tap="geAbsPath(userPath)" id="btn-path">用户文件目录uni.env.USER_DATA_PATH</button>
<button class="btnstyle" type="primary" @tap="geAbsPath(internalSandboxPath)"
id="btn-path">应用内置沙盒目录uni.env.ANDROID_INTERNAL_SANDBOX_PATH</button>
<!-- #endif -->
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
export default {
data() {
return {
log: "",
userPath: uni.env.USER_DATA_PATH,
sandboxPath: uni.env.SANDBOX_PATH,
cachePath: uni.env.CACHE_PATH,
internalSandboxPath: uni.env.ANDROID_INTERNAL_SANDBOX_PATH,
}
},
onLoad() {
},
methods: {
geAbsPath(path ?: Any) {
this.log += UTSAndroid.convert2AbsFullPath(path as String) + '\n'
}
}
}
</script>
<style>
.btnstyle {
margin: 4px;
}
</style>
......@@ -448,6 +448,10 @@
{
name: 'fileSystemManager文件管理',
url: 'get-file-system-manager'
},
{
name: 'uni.env',
url: 'get-file-uni-env'
},
] as Page[],
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册