We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import Recorder from 'recorder-core' import '../../../../../uni_modules/Recorder-UniCore/app-uni-support.js' // #ifdef MP-WEIXIN import 'recorder-core/src/app-support/app-miniProgram-wx-support.js' // #endif
import RecordApp from 'recorder-core/src/app-support/app.js' // import { ref, getCurrentInstance, onMounted, onUnmounted } from 'vue'; import { onShow } from '@dcloudio/uni-app' const isVue3=ref(true); const recpowerx=ref(0); const recpowert=ref(""); const reclogs=ref([]); const isRunning = ref(false); // 控制计时器状态v const currentTime = ref(0); // 存储当前时间(秒) var vue3This=getCurrentInstance().proxy; //必须定义到最外面,getCurrentInstance得到的就是当前实例this onMounted(()=>{ vue3This.isMounted=true; RecordApp.UniPageOnShow(vue3This); //onShow可能比mounted先执行,页面准备好了时再执行一次 }); onUnmounted(()=>{ RecordApp.Stop(); //清理资源,如果打开了录音没有关闭,这里将会进行关闭 }); onShow(()=>{ if(vue3This.isMounted) RecordApp.UniPageOnShow(vue3This); //onShow可能比mounted先执行,页面可能还未准备好 });
最后报错RecordApp.UniPageOnShow is not a function 大佬们怎么解决呢
The text was updated successfully, but these errors were encountered:
import RecordApp from 'recorder-core/src/app-support/app.js' 这句要放到 app-uni-support.js 前面
Sorry, something went wrong.
No branches or pull requests
import Recorder from 'recorder-core'
import '../../../../../uni_modules/Recorder-UniCore/app-uni-support.js'
// #ifdef MP-WEIXIN
import 'recorder-core/src/app-support/app-miniProgram-wx-support.js'
// #endif
import RecordApp from 'recorder-core/src/app-support/app.js'
// import { ref, getCurrentInstance, onMounted, onUnmounted } from 'vue';
import { onShow } from '@dcloudio/uni-app'
const isVue3=ref(true);
const recpowerx=ref(0);
const recpowert=ref("");
const reclogs=ref([]);
const isRunning = ref(false); // 控制计时器状态v
const currentTime = ref(0); // 存储当前时间(秒)
var vue3This=getCurrentInstance().proxy; //必须定义到最外面,getCurrentInstance得到的就是当前实例this
onMounted(()=>{
vue3This.isMounted=true;
RecordApp.UniPageOnShow(vue3This); //onShow可能比mounted先执行,页面准备好了时再执行一次
});
onUnmounted(()=>{
RecordApp.Stop(); //清理资源,如果打开了录音没有关闭,这里将会进行关闭
});
onShow(()=>{
if(vue3This.isMounted) RecordApp.UniPageOnShow(vue3This); //onShow可能比mounted先执行,页面可能还未准备好
});
最后报错RecordApp.UniPageOnShow is not a function
大佬们怎么解决呢
The text was updated successfully, but these errors were encountered: