更新页面
This commit is contained in:
22
src/App.vue
22
src/App.vue
@ -6,10 +6,12 @@
|
||||
</router-view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, nextTick, provide, onMounted } from "vue";
|
||||
import * as ocr from "@paddlejs-models/ocr";
|
||||
import { ref, nextTick, provide, onMounted,getCurrentInstance } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { getItem } from "@/utils/storage";
|
||||
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const store = useStore();
|
||||
generateNewStyle(store.getters.mainColor).then((newStyle) => {
|
||||
writeNewStyle(newStyle);
|
||||
@ -23,9 +25,25 @@ const reload = () => {
|
||||
};
|
||||
provide("reload", reload);
|
||||
onMounted(() => {
|
||||
let dept = getItem("deptId");
|
||||
document.title = "林芝";
|
||||
initPage()
|
||||
});
|
||||
|
||||
/**
|
||||
*@Descripttion:图片页面初始化
|
||||
*@Author: PengShuai
|
||||
*/
|
||||
const initPage = async () => {
|
||||
try {
|
||||
await ocr.init();// 模型初始化
|
||||
imgIsLoad = true;
|
||||
proxy.$message({ type: "success", message: "加载成功" });
|
||||
} catch (err) {
|
||||
proxy.$message({ type: "error", message: "加载失败,请刷新页面" });
|
||||
imgIsLoad = false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "./styles/index.scss";
|
||||
|
||||
Reference in New Issue
Block a user