uni-app icon indicating copy to clipboard operation
uni-app copied to clipboard

fix(uni-mp-compiler): wxs方法支持变量作为参数

Open zhylmzr opened this issue 1 year ago • 1 comments

fixed: https://github.com/dcloudio/uni-app/issues/4633

zhylmzr avatar May 15 '24 07:05 zhylmzr

感谢提供 PR,已在 review

Otto-J avatar Mar 27 '25 03:03 Otto-J

这个修复有点问题,不能正确处理多参数以及嵌套参数的场景,比如下面的示例

<template>
  <text class="title">reacitve object: {{ wxs.formatInfo(user, wxs.formatInfo(user)) }}</text>
</template>

<script module="wxs" lang="wxs">
var formatInfo = function (info, b) {
    if(!info) {
        return 'dsds'
    }
    return '我是 ' + info.name + ", 今年 " + info.age
}

module.exports = {
    formatInfo: formatInfo
}
</script>

<script>
export default {
    data() {
        return {
            user: {
                name: 'Test4',
                age: '18'
            }
        }
    }
}
</script>

chouchouji avatar Sep 18 '25 12:09 chouchouji