Closed Jackie-5 closed 1 year ago
需要声明一下 _scope 这个props,如果不声明的话,在小程序 taro runtime 下,setData 的时候会有一个 自引用的对象,会导致小程序模板渲染时爆栈
defineComponent({
props: {
_scope: {
type: Object
}
}
})
需要声明一下 _scope 这个props,如果不声明的话,在小程序 taro runtime 下,setData 的时候会有一个 自引用的对象,会导致小程序模板渲染时爆栈
defineComponent({ props: { _scope: { type: Object } } })
感谢 已经可以了
可以帮忙提交下 PR 修改 Taro example 哈~
需要声明一下 _scope 这个props,如果不声明的话,在小程序 taro runtime 下,setData 的时候会有一个 自引用的对象,会导致小程序模板渲染时爆栈
defineComponent({ props: { _scope: { type: Object } } })
@jxxbd91 taro build native-components --type weapp --watch
构建出来是正常的。但是taro build native-components --type weapp
构建出来的就会堆栈溢出,需要 props 加上 _scope 才正常。
相关平台
微信小程序
小程序基础库: 2.14.4 使用框架: Vue 3
复现步骤
重现链接 https://github.com/Jackie-5/taro-vue3-to-mini
使用 NODE_ENV=production taro build native-components --type weapp 编译后
vue3的写法改为
到原生小程序就会看到报错,如果把 NODE_ENV 改为 development 就不会报错
我这边直接使用的是官方的 demo https://github.com/NervJS/taro/tree/next/examples/blended-taro-component-vue3
可以把任意的.vue文件的 改为上述描写就会报错
https://github.com/Jackie-5/taro-vue3-to-mini 这里已经提供两种写法
期望结果
不要报错并成功编译
实际结果
转过去后 用原生小程序打开就会报 Maximum call stack size exceeded
环境信息