问题模块 框架类型 终端类型 微信版本 基础库版本
框架 微信小程序 工具 开发者工具 1.9.91
自定义组件报错,
VM79506: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:64847/__pageframe__/__dev__/WAWebview.js:8:5912)
at r.safeCallback (http://127.0.0.1:64847/__pageframe__/__dev__/WAWebview.js:5:27178)
at r.call (http://127.0.0.1:64847/__pageframe__/__dev__/WAWebview.js:5:26942)
at t (http://127.0.0.1:64847/__pageframe__/__dev__/WAWebview.js:6:7737)
at t (http://127.0.0.1:64847/__pageframe__/__dev__/WAWebview.js:6:8050)
at t (http://127.0.0.1:64847/__pageframe__/__dev__/WAWebview.js:6:7992)
at t (http://127.0.0.1:64847/__pageframe__/__dev__/WAWebview.js:6:8050)
at t (http://127.0.0.1:64847/__pageframe__/__dev__/WAWebview.js:6:8050)
at t (http://127.0.0.1:64847/__pageframe__/__dev__/WAWebview.js:6:8050)
at t (http://127.0.0.1:64847/__pageframe__/__dev__/WAWebview.js:6:8050)
(anonymous) @ VM79506:2
VM79507:2 [Exparser] [Error] [Component] Lifetime Method Error @ wx-cover-view#attached
(anonymous) @ VM79507:2
VM79508:2 TypeError: Cannot read property 'replace' of undefined
at o.attached (:64847/__pageframe__/__dev__/WAWebview.js:8)
at r.safeCallback (:64847/__pageframe__/__dev__/WAWebview.js:5)
at r.call (:64847/__pageframe__/__dev__/WAWebview.js:5)
at t (:64847/__pageframe__/__dev__/WAWebview.js:6)
at t (:64847/__pageframe__/__dev__/WAWebview.js:6)
at t (:64847/__pageframe__/__dev__/WAWebview.js:6)
at t (:64847/__pageframe__/__dev__/WAWebview.js:6)
at t (:64847/__pageframe__/__dev__/WAWebview.js:6)
at t (:64847/__pageframe__/__dev__/WAWebview.js:6)
at t (:64847/__pageframe__/__dev__/WAWebview.js:6)
(anonymous) @ VM79508:2
组件如下:
js:
Component({
properties: {
top: {
type: Number,
value: 0
},
left: {
type: Number,
value: 0
},
iconSrc: {
type: String,
value: ''
},
animation: {
type: Object,
value: {}
}
}
});
wxml:
wxss:
.indicator{
opacity: 0.6;
z-index: 999;
color: white;
font-size: 26rpx;
position: absolute;
background-color: #565A5C;
}
.indicator-tip{
margin: 24rpx 42rpx;
display: flex;
justify-content: space-around;
}
.indicator-icon{
width: 36rpx;
height: 36rpx;
margin-right: 10rpx;
}
json:
{
"component": true
}
组件使用:
json:
{
"disableScroll": true,
"usingComponents": {
"mapindicator": "/pages/components/mapindicator/mapindicator"
}
}
wxml:
xxxxxxxxxxxxxx微信小程序开发问题解答
微信小程序开发者回答:
引入页html
付款
微信小程序开发者回答:
腾讯的大神们好好处理一下cover-系列的组件吧,太难用了
微信小程序开发者回答:
怎么没有意义,你能说img标签的src属性没有意义吗?
微信小程序开发者回答:
各位,我试过了,是cover-view的问题,把cover-view换成view,cover-image开始报错,再把cover-image换成image,不报错了
微信小程序开发者回答:
mapindicator 这个标签内部显示的内容就是 你这个插件先不说写法对不对,存在完全没意义啊,资源都是固定的clear-all.png
微信小程序开发者回答:
你自定义组件的内部iconSrc需要写到插件的data里,properties里面的字段是对外引用字段
微信小程序开发者回答:
有时开发工具会有bug,重新编译即可,不知道你是不是这种情况
本文网址:http://www.91bianli.com/weixinxiaochengxu/48915.html