Skip to content
New issue

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

fix: 修复?.可选调用表达式获取自定义属性时不做转换问题,包含测试用例 #338

Closed
wants to merge 2 commits into from

Conversation

fahasikei
Copy link

/

这个 PR 做了什么? (简要描述所做更改)

修复?.可选调用表达式获取自定义属性时不做转换问题,包含测试用例

这个 PR 是什么类型? (至少选择一个)

  • 错误修复(Bugfix) issue: fix #
  • 新功能(Feature)
  • 代码重构(Refactor)
  • TypeScript 类型定义修改(Typings)
  • 文档修改(Docs)
  • 代码风格更新(Code style update)
  • 其他,请描述(Other, please describe):

这个 PR 涉及以下平台:

  • 所有小程序
  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 字节跳动小程序
  • QQ 轻应用
  • 京东小程序
  • 快应用平台(QuickApp)
  • Web 平台(H5)
  • 移动端(React-Native)
  • 鸿蒙(harmony)

test('当使用e.target.dataset时引入工具函数 getTarget', () => {
const entryJSON = { 'pages': ['pages/index/index'] }
// json:index.json的内容 path:index的根目录(文件路径) rootPath:小程序的根目录(文件路径)
// script:index.js的内容 scriptPath:index.js的绝对路径 wxml:index.html的内容

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用多行注释是不是会好一点,不要一行多个注释

<button data-tagName="WX1314" data-tagData="{{ tagInfo }}" bindtap="getMsg02">调用自身方法获取自定义信息</button>
<button data-tagName="WX1314" data-tagData="{{ tagInfo }}" catchtap="convertGetDataset02">调用外部方法获取自定义信息</button>
`
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的测试用例内容是否过于复杂,自行判断,如果合适的话,可以忽略,如果过于复杂的话,要精简一些

}
}
},
OptionalMemberExpression (astPath) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数描述需要添加吗

//变量赋值
const tagName_ = e.currentTarget.dataset.tagName
const tagData_ = e.currentTarget.dataset.tagData
console.log('data-xxx-xxx格式的e.currentTarget.dataset.tagName',tagName_)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log不要提交

console.log('data-xxxXxx格式的解构赋值tagname',tagname)
console.log('data-xxxXxx格式的解构赋值tagdata',tagdata)
},
convertGetDataset,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这;两行是啥

`,
scriptPath:'',
wxml:`
测试data-xxx-xxx写法

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加个view

@fahasikei fahasikei closed this Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants