这个调试错误是什么意思?什么东西没有定义吗?还是配置?麻烦大家了
发布于 4 年前 作者 mlu 13181 次浏览 来自 问答

wxml代码:

<view class="splice-page">

  <!--隐藏canvas-->

  <canvas canvas-id="tempCanvasstyle="width:750rpx;height:{{totalHeight}}px;position:absolute;left:-999999px"></canvas>

  <!--保存按钮-->

  <view class="saveButtonwx:if="{{readuSave}}bindtap="saveImgToPhonestyle="background:url('../frame/background-pink.jpg')"> <test class="icon-save"></test></view>

  <!--拼长图页面-->

  <scroll-view scroll-y class="longImagewx:if="{{page=='longImages'}}style="height:{{imgViewHeight}}px">

    <view class="img-wrapboxwx:for="{{longImageSrcs}}wx:key="*this">

      <image src="{{item}}mode="widthFixdata-idx="{{index}}catchlongtap="gotoDeletecatchtap="quitDelete"></image>

      <text class="deleteTextBoxwx:if="{{whichDeleteShow==index}}bindtap="deleteImgstyle="top:50%">删除这张?</text>

    </view>

  </scroll-view>

  <!--拼相框页面-->

<view class="photoFramewx:if="{{page==='photoFrame'}}style="height:{{frameHeight}}pxbindtouchstart="uploadScaleStartbindtouchmove="uploadScaleMovebindtouchend="uploadScaleEnd">

<image class="framesrc="{{frameSrc}}mode="widthFix"></image>

<image class="photosrc="{{photoSrc}}style="width:{{photoWidth}}px;height:{{photoHeight}}px;top:{{photoTop}}px;left:{{photoLeft}}px"  disable-scroll="true"></image>


</view>

<!--拼长图页面的底部工具栏-->

<view class="toolbar-bottomwx:if="{{page==='longImages'}}">

  <view bindtap="addImages"><text class="icon-listadd"></text><text class="text">添加图片</text></view>

</view>


<!--相框页面的底部工具栏-->

<view class="toolbar-bottomwx:if="{{page==='photoFrame'}}">

  <view bindtap="addFrame"><text class="icon-frame"></text><text class="text">选择相框</text></view>

  <view bindtap="addPhoto"><text class="icon-photo"></text><text class="text">添加照片</text></view>

</view>


<!--相框选择窗口-->

<view class="frameChoosewx:if="{{isFrameChoose}}">

  <view class="frameChoose-top"><text class="farmeChoose-top-left">选择相框</text><text class="farmeChoose-top-rightbindtap="closeFrameChoose"></text> </view>

<scroll-view scroll-y>

  <view wx:for="{{frameSrcs}}wx:key="*thisdata-src="{{item.src}}class="frameBoxbindtap="chooseFrame">

    <image src="{{'../frame'+item.src}}mode="aspectFit"></image><text>{{item.title}}</text>

  </view>

</scroll-view>


</view>


</view>

调试错误:

VM56 WAService.js:2 TypeError: Cannot read property 'windowWidth' of undefined

    at vt.onLoad (index.js? [sm]:27)

    at vt.<anonymous> (VM56 WAService.js:2)

    at vt.r.__callPageLifeTime__ (VM56 WAService.js:2)

    at nn (VM56 WAService.js:2)

    at VM56 WAService.js:2

    at cn (VM56 WAService.js:2)

    at Function.<anonymous> (VM56 WAService.js:2)

1 回复

这不是说的很清楚了 index.js 27 行 windowWidth 未定义

去js里找。 wxml 是视图页

回到顶部