首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用自定义组价报错 ?

使用自定义组价报错 ?

提问于 2018-03-16 01:39:20
回答 3关注 0查看 1.1K

自定义组件报错,

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:

<cover-view class="indicator" style="top:{{top}}rpx; left:{{left}}rpx;" animation="{{animation}}">

<cover-view class="indicator-tip">

<cover-image class="indicator-icon" src="{{iconSrc}}"></cover-image>

<!--a-->

<slot></slot>

</cover-view>

</cover-view>

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:

<mapindicator top="800" left="" iconSrc="/static/images/clear/clear-all.png">xxxxxxxxxxxxxx</mapindicator>

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档