Files
lilishop-uniapp/pages/tabbar/home/web-view.vue
Yer11214 1fcc016ccd refactor: 将深度选择器语法更新为v-deep
-在多个Vue和SCSS文件中用::v-deep替换弃用的/deep/选择器,以便更好地与Vue的范围样式兼容。
2025-10-21 10:33:59 +08:00

54 lines
1016 B
Vue

<template>
<view class="web-view">
<web-view :webview-styles="webviewStyles" :src="src"></web-view>
</view>
</template>
<script>
import configs from "@/config/config";
import storage from "@/utils/storage";
export default {
data() {
return {
configs,
storage,
webviewStyles: {
progress: {
color: this.$lightColor,
},
},
src: "",
};
},
onLoad(params) {
// params.IM ? (this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`): (this.src = decodeURIComponent(params.src));
if(params.IM)
{
if(params.IM==0)
{
this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}`;
}
else
{
this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`;
}
}
else
{
this.src = decodeURIComponent(params.src);
console.log(this.src);
}
},
};
</script>
<style lang="scss" scoped>
.web-view {
::v-deep .web-view {
padding: 0;
margin: 0;
}
}
</style>