This commit is contained in:
那些花儿
2025-09-18 15:57:10 +08:00
parent b05de4830c
commit 241d207034
6 changed files with 61 additions and 19 deletions
@@ -19,7 +19,7 @@ const styleUtil = {
// } // }
// } // }
// 使用TreeWalker优化遍历性能 // 查找本组件的子元素 但是排除掉VUE组件 使用TreeWalker优化遍历性能
const walker = document.createTreeWalker( const walker = document.createTreeWalker(
el, el,
NodeFilter.SHOW_ELEMENT, NodeFilter.SHOW_ELEMENT,
@@ -51,16 +51,6 @@ const styleUtil = {
// 处理根元素 // 处理根元素
el.removeAttribute(scopedId); el.removeAttribute(scopedId);
// if (el && el.removeAttribute) {
// el.removeAttribute(scopedId)
//
// // 递归处理所有子元素
// const children = el.children || el.childNodes
// for (let i = 0; i < children.length; i++) {
// styleUtil.removeScopedAttribute(children[i], scopedId)
// }
// }
}, },
// 为CSS规则添加作用域属性 // 为CSS规则添加作用域属性
@@ -72,11 +62,15 @@ const styleUtil = {
const processedSelectors = selectors.split(',') const processedSelectors = selectors.split(',')
.map(selector => { .map(selector => {
selector = selector.trim(); selector = selector.trim();
// 处理深度选择器 // 处理深度选择器
if (selector.includes('::v-deep')) { if (selector.includes('::v-deep')) {
return selector.replace('::v-deep', `[${scopedId}]`); return selector.replace('::v-deep', `[${scopedId}]`);
} }
if(selector.includes("/deep/")){
return selector.replace('/deep/', `[${scopedId}]`);
}
// 处理媒体查询等特殊情况 // 处理媒体查询等特殊情况
if (selector.includes('@') || selector.startsWith('@')) { if (selector.includes('@') || selector.startsWith('@')) {
@@ -68,6 +68,8 @@
<!--g2plot--> <!--g2plot-->
<script src="${base!}/assets/platform/plugins/g2plot/g2plot.min.js"></script> <script src="${base!}/assets/platform/plugins/g2plot/g2plot.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/goober@2.1.10/dist/goober.umd.js"></script>
<script> <script>
window._AMapSecurityConfig = { window._AMapSecurityConfig = {
securityJsCode: "4fa1e1aeabba7eb9518129cf57ab17c1" securityJsCode: "4fa1e1aeabba7eb9518129cf57ab17c1"
@@ -318,7 +318,7 @@ E.先进性"
padding: 10px 20px; padding: 10px 20px;
} }
::v-deep .txt-import-container { /deep/ .txt-import-container {
display: flex; display: flex;
height: 80vh; height: 80vh;
border-radius: 4px; border-radius: 4px;
@@ -2,6 +2,13 @@
layout("/layouts/platform_h5.html"){ layout("/layouts/platform_h5.html"){
#--> #-->
<style>
.profile-card{
background: #0a84ff;
color: #0b5a2c;
}
</style>
<div id="app" v-cloak> <div id="app" v-cloak>
<div> <div>
<div> <div>
@@ -72,12 +72,12 @@ const mine = {
</span> </span>
</van-cell> </van-cell>
<!-- <van-cell :value="$store.state.user.totalIntegral" is-link @click="$pjaxReplace('/platform/integral/records/h5')" class="action-cell">--> <!-- <van-cell :value="$store.state.user.totalIntegral" is-link @click="$pjaxReplace('/platform/integral/records/h5')" class="action-cell">-->
<!-- <span class="cell-title" slot="title">--> <!-- <span class="cell-title" slot="title">-->
<!-- <van-icon name="points" class="cell-icon"></van-icon>--> <!-- <van-icon name="points" class="cell-icon"></van-icon>-->
<!-- 我的积分--> <!-- 我的积分-->
<!-- </span>--> <!-- </span>-->
<!-- </van-cell>--> <!-- </van-cell>-->
</van-cell-group> </van-cell-group>
</div> </div>
@@ -108,6 +108,7 @@ const mine = {
}) })
} }
}, },
style() { style() {
return /*language=CSS*/ ` return /*language=CSS*/ `
.home-mine { .home-mine {
@@ -28,6 +28,44 @@ const work = {
this.$pjaxReplace(item.href) this.$pjaxReplace(item.href)
} }
}, },
mounted() {
const styles = {
workbenche: window.goober.css`
padding: 16px;
background: #f5f5f5;
`,
moduleItem: goober.css`
margin-bottom: 16px;
background: white;
border-radius: 8px;
overflow: hidden;
`,
moduleHeader: goober.css`
padding: 12px 16px;
background: #fafafa;
border-bottom: 1px solid #eee;
`,
moduleHeaderContent: goober.css`
border-left: 4px solid var(--color-primary);
font-size: 15px;
color: #000;
font-weight: 600;
padding-left: 8px;
`,
moduleContent: goober.css`
padding: 8px;
.van-grid-item__content {
padding: 14px 8px;
}
`,
menuIcon: goober.css`
width: 40px;
height: 40px;
`
};
console.log(styles)
},
style: /*language=CSS*/ ` style: /*language=CSS*/ `
.left-span-label { .left-span-label {
border-left: 4px solid var(--color-primary); border-left: 4px solid var(--color-primary);