wxml-transformer
wxml-transformer copied to clipboard
wxml标签内无属性时报错TypeError: Cannot convert undefined or null to object
[email protected] [email protected]
复现步骤:
const wt = require('wxml-transformer')
wt.toHtml(`<view id="con">{{ 123 }}</view>`) // 没问题
wt.toHtml(`<view>{{ 123 }}</view>`) // 报下面的错
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at elementToObject (D:\GitHubOther\Plz-shop\node_modules\wxml-transformer\dist\index.js:137:16)
at D:\GitHubOther\Plz-shop\node_modules\wxml-transformer\dist\index.js:174:21
at each (D:\GitHubOther\Plz-shop\node_modules\wxml-transformer\dist\index.js:12:13)
at toObject (D:\GitHubOther\Plz-shop\node_modules\wxml-transformer\dist\index.js:173:5)
at Object.toHtml (D:\GitHubOther\Plz-shop\node_modules\wxml-transformer\dist\index.js:274:22)