We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
H5
https://github.com/taroify/taro330-dataset 浏览器版本: Chrome 91.0.4472.114 使用框架: React
import {Text, View} from '@tarojs/components' import {useReady} from '@tarojs/taro'; import {useRef} from 'react'; export default function Index() { const viewRef = useRef<HTMLElement>() const textRef = useRef<HTMLElement>() const divRef = useRef<HTMLDivElement>(null) useReady(() => { console.log(viewRef.current?.dataset) console.log(textRef.current?.dataset) console.log(divRef.current?.dataset) }) return ( <> <View ref={viewRef} data-index='view-value'>View dataset</View> <Text ref={textRef} data-index='text-value'>Text dataset</Text> <div ref={divRef} data-index='div-value'>Div dataset</div> </> ) }
主要问题是 如 View,Text 这种 Taro 内置组件不支持自定的 dataset 属性。
index: "view-value" index: "text-value"
index: undefined index: undefined
� Taro v3.3.0 Taro CLI 3.3.0 environment info: System: OS: Windows 10 Binaries: Node: 14.17.1 - C:\Programs\nodejs\node-v14.17.1-win-x64\node.EXE Yarn: 1.22.10 - C:\Programs\nodejs\node-v14.17.1-win-x64\yarn.CMD npm: 6.14.13 - C:\Programs\nodejs\node-v14.17.1-win-x64\npm.CMD
The text was updated successfully, but these errors were encountered:
fix(h5): 让 h5 支持 dataset,fix #9798
0e1e98f
485efc3
fix(h5): 让 h5 支持 dataset,fix NervJS#9798
6592fc0
Successfully merging a pull request may close this issue.
相关平台
H5
复现仓库
https://github.com/taroify/taro330-dataset
浏览器版本: Chrome 91.0.4472.114
使用框架: React
复现步骤
Taro h5 无法获得 View, Text 等组件的自定义的 dataset 值
BUG 复现代码
在 weapp 执行结果:
在 h5 执行结果:
期望结果:
主要问题是 如 View,Text 这种 Taro 内置组件不支持自定的 dataset 属性。
期望结果
index: "view-value"
index: "text-value"
实际结果
index: undefined
index: undefined
环境信息
The text was updated successfully, but these errors were encountered: