Browse Source

feat: wot 主题色配置

菲鸽 2 years ago
parent
commit
ddcba22c3e
5 changed files with 17 additions and 5 deletions
  1. 1 0
      manifest.config.ts
  2. 4 2
      src/layouts/default.vue
  3. 4 2
      src/layouts/demo.vue
  4. 2 1
      src/manifest.json
  5. 6 0
      src/style/index.scss

+ 1 - 0
manifest.config.ts

@@ -89,6 +89,7 @@ export default defineManifestConfig({
   },
   },
   'mp-alipay': {
   'mp-alipay': {
     usingComponents: true,
     usingComponents: true,
+    styleIsolation: 'shared',
   },
   },
   'mp-baidu': {
   'mp-baidu': {
     usingComponents: true,
     usingComponents: true,

+ 4 - 2
src/layouts/default.vue

@@ -1,5 +1,7 @@
 <template>
 <template>
-  <view class="default-layout">
+  <wd-config-provider>
     <slot />
     <slot />
-  </view>
+    <wd-toast />
+    <wd-message-box />
+  </wd-config-provider>
 </template>
 </template>

+ 4 - 2
src/layouts/demo.vue

@@ -1,5 +1,7 @@
 <template>
 <template>
-  <view class="demo-layout">
+  <wd-config-provider>
     <slot />
     <slot />
-  </view>
+    <wd-toast />
+    <wd-message-box />
+  </wd-config-provider>
 </template>
 </template>

+ 2 - 1
src/manifest.json

@@ -59,7 +59,8 @@
     "usingComponents": true
     "usingComponents": true
   },
   },
   "mp-alipay": {
   "mp-alipay": {
-    "usingComponents": true
+    "usingComponents": true,
+    "styleIsolation": "shared"
   },
   },
   "mp-baidu": {
   "mp-baidu": {
     "usingComponents": true
     "usingComponents": true

+ 6 - 0
src/style/index.scss

@@ -5,3 +5,9 @@
   padding-top: 4px;
   padding-top: 4px;
   color: red;
   color: red;
 }
 }
+
+:root,
+page {
+  // 修改按钮背景色
+  --wot-button-primary-bg-color: green;
+}