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

ui-v-tab使用反馈 #22

Open
a596544022 opened this issue Jun 16, 2018 · 1 comment
Open

ui-v-tab使用反馈 #22

a596544022 opened this issue Jun 16, 2018 · 1 comment

Comments

@a596544022
Copy link

<ui-v-tab wx:for="{{ tabItems }}">
    {{ item.name }}
</ui-v-tab>

里面的tabItems 默认为空数组,然后通过setData来设置的话,会报错

thirdScriptError
Cannot read property 'setData' of undefined; [Component] Lifetime Method Error @ packages/touchui-wx-components/ui-v-tabs/dist/index#ready
TypeError: Cannot read property 'setData' of undefined
    at r._initChildActive (http://127.0.0.1:39865/appservice/packages/touchui-wx-components/ui-v-tabs/dist/index.js:87:46)
    at r._init (http://127.0.0.1:39865/appservice/packages/touchui-wx-components/ui-v-tabs/dist/index.js:75:12)
    at ready (http://127.0.0.1:39865/appservice/packages/touchui-wx-components/ui-v-tabs/dist/index.js:68:10)
    at r.safeCallback (http://127.0.0.1:39865/appservice/__dev__/WAService.js:14:1544)
    at r.call (http://127.0.0.1:39865/appservice/__dev__/WAService.js:14:1308)
    at i.p.triggerLifeTime (http://127.0.0.1:39865/appservice/__dev__/WAService.js:15:7042)
    at http://127.0.0.1:39865/appservice/__dev__/WAService.js:16:8418
    at d (http://127.0.0.1:39865/appservice/__dev__/WAService.js:16:10639)
    at a (http://127.0.0.1:39865/appservice/appservice?t=1529139472121:1120:9472)
    at e.registerCallback (http://127.0.0.1:39865/appservice/appservice?t=1529139472121:1120:9659)

通过断点发现是因为没有找到节点,具体怎么解决尚不清楚

@uileader
Copy link
Owner

含有子组件的动态渲染需要有个判断。见文档:
http://www.touchui.io/touchui_doc_wx/component/summary/Introduction

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

No branches or pull requests

2 participants