omi-mp对is解析出错

l7mqbcuq  于 2022-10-20  发布在  其他
关注(0)|答案(5)|浏览(173)
  • No description provided.*
2ul0zpep

2ul0zpep1#

is="{{configData._comName=='pintuanlist'?'discountlist':configData._comName}}"
这种语法,gulp直接报错

xtfmy6hx

xtfmy6hx3#

wxml

<view class="container">
  <view class="usermotto" is="{{configData._comName=='pintuanlist'?'discountlist':configData._comName}}">
    <text class="user-motto">{{motto}}</text>
  </view>
</view>

编译后:

function render() {
  const { configData,motto } = Object.assign({}, this.data, this.props)
  return h('div',{'class': `container`},[h('div',{'class': `usermotto`,'is': configData._comName=='pintuanlist'?'discountlist':configData._comName},[h('span',{'class': `user-motto`},[`${motto}`])])])
}

试了下没问题。你更新下 omi-cli。你可能用了老的~~

jdg4fx2g

jdg4fx2g4#

<template wx:if="{{configData._comName == 'tuangou'}}" is="{{configData._comName}}" data="{{...(_comConfig['Dazhe_'+configData.data.item.value.item_id+'_']),comName:configData.trueName,_comConfig,device,moneyFuhao:moneyFuhao,pageStyle,store_id}}"></template>

应该是这句解析引起的

相关问题