NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.66k stars 4.8k forks source link

按照taro-cli搭建的脚手架默认是会开启分享的嘛?且此时设置useShareAppMessage 的title并不生效。 #12994

Closed susu0628 closed 1 year ago

susu0628 commented 1 year ago

相关平台

H5

复现仓库

https://github.com/susu0628/my-test.git 浏览器版本: Chrome 108.0.5359.125 使用框架: React

复现步骤

执行命令 taro dev:h5 运行在钉钉端,发现分享是默认开启的,且此时设置useShareAppMessage 的title并不生效。

期望结果

分享能自己手动设置,且useShareAppMessage 能生效

实际结果

分享默认开启,useShareAppMessage 不生效

环境信息

Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating

  Taro CLI 3.4.3 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 16.10.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.18 - C:\Users\y1205\AppData\Roaming\npm\yarn.CMD
      npm: 7.24.0 - C:\Program Files\nodejs\npm.CMD

补充信息

package.json 如下 { "name": "my-test", "version": "1.0.0", "private": true, "description": "test", "templateInfo": { "name": "mobx", "typescript": true, "css": "less" }, "scripts": { "build:weapp": "taro build --type weapp", "build:swan": "taro build --type swan", "build:alipay": "taro build --type alipay", "build:tt": "taro build --type tt", "build:h5": "taro build --type h5", "build:rn": "taro build --type rn", "build:qq": "taro build --type qq", "build:quickapp": "taro build --type quickapp", "dev:weapp": "npm run build:weapp -- --watch", "dev:swan": "npm run build:swan -- --watch", "dev:alipay": "npm run build:alipay -- --watch", "dev:tt": "npm run build:tt -- --watch", "dev:h5": "npm run build:h5 -- --watch", "dev:rn": "npm run build:rn -- --watch", "dev:qq": "npm run build:qq -- --watch", "dev:quickapp": "npm run build:quickapp -- --watch" }, "browserslist": [ "last 3 versions", "Android >= 4.1", "ios >= 8" ], "author": "", "license": "MIT", "dependencies": { "@babel/runtime": "^7.7.7", "@tarojs/runtime": "3.4.3", "@tarojs/taro": "3.4.3", "@tarojs/components": "3.4.3", "@tarojs/plugin-framework-react": "3.4.3", "mobx": "^4.8.0", "mobx-react": "^6.1.4", "preact": "^10.5.15" }, "devDependencies": { "@types/webpack-env": "^1.13.6", "@types/react": "^17.0.2", "@tarojs/mini-runner": "3.4.3", "@babel/core": "^7.8.0", "@tarojs/webpack-runner": "3.4.3", "babel-preset-taro": "3.4.3", "eslint-config-taro": "3.4.3", "eslint": "^8.12.0", "eslint-plugin-react": "^7.8.2", "eslint-plugin-import": "^2.12.0", "eslint-plugin-react-hooks": "^4.2.0", "stylelint": "9.3.0", "@typescript-eslint/parser": "^5.20.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "typescript": "^4.1.0" } }

ZakaryCode commented 1 year ago

没太理解该 Issue 中所述的问题,shareAppMessage 通过 enableShareAppMessage 开启,并非默认开启,同时该特性并非 Web 端支持的特性,问题中说表述的应当是 dd 内核的浏览器设置分享,这需要参考钉钉相关文档自行配置(如果该浏览器内核支持)

另外 Issue 中提到的 title 问题,应当是设置浏览器标题无效导致的,由于钉钉浏览器特殊性默认不开启相关兼容配置,可以参考文档自行启用