ソースを参照

docs(configprovider): add reactive 默认响应式

richard1015 3 年 前
コミット
5bcc7234d0

+ 3 - 3
src/packages/__VUE/configprovider/doc.en-US.md

@@ -94,15 +94,15 @@ The ConfigProvider component provides the ability to override CSS variables. You
     </nut-config-provider>
 </template>
 <script lang="ts">
-  import { ref } from 'vue';
+  import { ref, reactive } from 'vue';
   export default {
     setup() {
       const range = ref(30);
-     const themeVars = {
+     const themeVars = reactive({
           primaryColor:'green',
           primaryColorEnd:'green',
           activeColor:'rgba(0,128,0,0.15)'
-      };
+      });
       // Of course, you can also choose to use component variables to replace. If both basic variables and component variables are set, the component variables will overwrite the basic variables
       //  const themeVars = {
       //   rangeBgColor: 'rgba(25,137,250,0.15)',

+ 3 - 3
src/packages/__VUE/configprovider/doc.md

@@ -95,14 +95,14 @@ app.use(ConfigProvider);
     </nut-config-provider>
 </template>
 <script lang="ts">
-  import { ref } from 'vue';
+  import { ref, reactive } from 'vue';
   export default {
     setup() {
       const range = ref(30);
-      const themeVars = {
+      const themeVars = reactive({
           primaryColor:'#008000',
           primaryColorEnd:'#008000',
-      };
+      });
       // 当然,你也可以选择使用组件变量去替换,如果同时设置了基础变量和组件变量,组件变量会覆盖基础变量。
       //  const themeVars = {
       //   rangeBgColor: 'rgba(25,137,250,0.15)',

+ 3 - 3
src/packages/__VUE/configprovider/doc.taro.md

@@ -95,14 +95,14 @@ page {
     </nut-config-provider>
 </template>
 <script lang="ts">
-  import { ref } from 'vue';
+  import { ref, reactive } from 'vue';
   export default {
     setup() {
       const range = ref(30);
-      const themeVars = {
+      const themeVars = reactive({
           primaryColor:'#008000',
           primaryColorEnd:'#008000',
-      };
+      });
       // 当然,你也可以选择使用组件变量去替换,如果同时设置了基础变量和组件变量,组件变量会覆盖基础变量。
       //  const themeVars = {
       //   rangeBgColor: 'rgba(25,137,250,0.15)',