uni-app Props的类型检查为Function时的默认值在H5端与小程序端表现不一致!

aelbi1ox  于 4个月前  发布在  uni-app
关注(0)|答案(2)|浏览(47)

问题描述
[问题描述:尽可能简洁清晰地把问题描述清楚]

复现步骤
[复现问题的步骤]
问题代码 在代码仓库
https://github.com/xyalim/testProp 中的 src/components/TestFunctionProp.vue
同时运行H5端与小程序端

[或者可以直接贴源代码]
代码地址 https://github.com/xyalim/testProp

预期结果
[使用简洁清晰的语言描述你希望生效的预期结果]
希望 H5端与小程序端表现一致

实际结果
[这里请贴上你的报错截图或文字]

系统信息:

  • 发行平台: [微信小程序、H5平台、5+ App等]

微信小程序、H5平台

  • 操作系统 [如 iOS 12.1.2、Android 7.0]
    win10
  • HBuilderX版本 [如使用HBuilderX,则需提供 HBuilderX 版本号]
  • uni-app版本 [如使用Vue-cli创建/运行项目,则提供 npm run info 的运行结果]
uni-app v3.6.4
uni-app cli v2.0.1-36420220922003

Environment Info:

  System:
    OS: Windows 10
    CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
  Binaries:
    Node: 14.18.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.15 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.18362.449.0
  npmPackages:
    @dcloudio/types: 2.6.12 => 2.6.12 
    @dcloudio/uni-app-plus: 2.0.1-36420220922003 => 2.0.1-36420220922003  
    @dcloudio/uni-app-plus-nvue:  0.0.1 
    @dcloudio/uni-app-plus-nvue-v8:  0.0.1 
    @dcloudio/uni-automator: 2.0.1-36420220922003 => 2.0.1-36420220922003 
    @dcloudio/uni-cli-i18n: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-cli-shared: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-h5: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-helper-json: * => 1.0.13
    @dcloudio/uni-i18n: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-migration: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-360: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-alipay: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-baidu: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-jd: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-kuaishou: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-lark: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-qq: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-toutiao: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-vue: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-weixin: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-mp-xhs: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-quickapp-native: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-quickapp-webview: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-stacktracey: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-stat: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/uni-template-compiler: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/vue-cli-plugin-hbuilderx: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/vue-cli-plugin-uni: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/vue-cli-plugin-uni-optimize: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/webpack-uni-mp-loader: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @dcloudio/webpack-uni-nvue-loader:  0.0.1
    @dcloudio/webpack-uni-pages-loader: 2.0.1-36420220922003 => 2.0.1-36420220922003
    @hap-toolkit/dsl-vue:  0.6.13
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1
    @vue/babel-helper-vue-transform-on:  1.0.2
    @vue/babel-plugin-jsx:  1.1.1
    @vue/babel-plugin-transform-vue-jsx:  1.2.1
    @vue/babel-preset-app:  4.5.19
    @vue/babel-preset-jsx:  1.3.0
    @vue/babel-sugar-composition-api-inject-h:  1.3.0
    @vue/babel-sugar-composition-api-render-instance:  1.3.0
    @vue/babel-sugar-functional-vue:  1.2.2
    @vue/babel-sugar-inject-h:  1.2.2
    @vue/babel-sugar-v-model:  1.3.0
    @vue/babel-sugar-v-on:  1.3.0
    @vue/cli-overlay:  4.5.19
    @vue/cli-plugin-babel: ~4.5.15 => 4.5.19
    @vue/cli-plugin-router:  4.5.19
    @vue/cli-plugin-typescript: ~4.5.15 => 4.5.19
    @vue/cli-plugin-vuex:  4.5.19
    @vue/cli-service: ~4.5.15 => 4.5.19
    @vue/cli-shared-utils:  4.5.19
    @vue/component-compiler-utils:  3.3.0 (3.3.0)
    @vue/devtools-api:  6.0.0-beta.15
    @vue/preload-webpack-plugin:  1.1.2
    @vue/shared: ^3.0.0 => 3.2.41
    @vue/web-component-wrapper:  1.3.0
    mpvue-page-factory:  1.0.1
    mpvue-template-compiler:  1.0.13
    uni-h5-vue:  2.6.10
    uni-mp-vue:  2.6.10
    vue: ~2.6.14 => 2.6.14
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.10.0 (16.8.3, 15.10.0)
    vue-router:  3.0.1
    vue-style-loader:  4.1.3 (4.1.3)
    vue-template-compiler: ^2.7.10 => 2.7.10 (2.7.4, 2.7.10)
    vue-template-es2015-compiler:  1.9.1
    vue3:  1.0.0
    vuex: ^3.2.0 => 3.6.2 (3.6.2)
  npmGlobalPackages:
    @vue/cli: Not Found
  • 设备信息 [如 iPhone8 Plus]

补充信息
[可选]
[根据你的分析,出现这个问题的原因可能在哪里?]

相关问题