自定义组件中使用 cover-view
发布于 6 年前 作者 rma 13223 次浏览 来自 问答

自定义组件中使用 cover-view报如下错误:

Mon Mar 19 2018 00:24:38 GMT+0800 (CST) 渲染层错误

VM3945:2 webviewScriptError

Cannot read property ‘replace’ of undefined;[Exparser] [Error] [Component] Lifetime Method Error @ wx-cover-view#attached

TypeError: Cannot read property ‘replace’ of undefined

    at o.attached (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:8:5912)

    at r.safeCallback (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:5:27178)

    at r.call (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:5:26942)

    at t (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:6:7737)

    at t (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:6:8050)

    at t (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:6:7992)

    at t (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:6:8050)

    at t (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:6:8050)

    at t (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:6:8050)

    at t (http://127.0.0.1:49651/__pageframe__/__dev__/WAWebview.js:6:7992)

(anonymous) @ VM3945:2

VM3947:1 Mon Mar 19 2018 00:24:38 GMT+0800 (CST) 渲染层错误

VM3947:2 [Exparser] [Error] [Component] Lifetime Method Error @ wx-cover-view#attached

(anonymous) @ VM3947:2

VM3948:1 Mon Mar 19 2018 00:24:38 GMT+0800 (CST) 渲染层错误

VM3948:2 TypeError: Cannot read property ‘replace’ of undefined

    at o.attached (:49651/__pageframe__/__dev__/WAWebview.js:8)

    at r.safeCallback (:49651/__pageframe__/__dev__/WAWebview.js:5)

    at r.call (:49651/__pageframe__/__dev__/WAWebview.js:5)

    at t (:49651/__pageframe__/__dev__/WAWebview.js:6)

    at t (:49651/__pageframe__/__dev__/WAWebview.js:6)

    at t (:49651/__pageframe__/__dev__/WAWebview.js:6)

    at t (:49651/__pageframe__/__dev__/WAWebview.js:6)

    at t (:49651/__pageframe__/__dev__/WAWebview.js:6)

    at t (:49651/__pageframe__/__dev__/WAWebview.js:6)

    at t (:49651/__pageframe__/__dev__/WAWebview.js:6)

(anonymous) @ VM3948:2

6 回复

把它嵌套在canvas里面可以行得通

不行 没有看到wx开发者文档么 cover-view里只能放cover-view 和cover-image 除此之外不能放其他标签

非也,我的意思是在自定义组件时,最外层用一个原生组件(canvas)包一下,如果直接用cover-view会有问题

是 <cover-view> </cover-view>,我想定义一个带遮罩的自定义组件,用在map上。

wx-cover-view这个是什么玩意?微信有这组件的

回到顶部