[plugin:vite:vue] unknown directive{"type":7,"name":"html","exp":{"type":4,"loc":{"source":"","start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":1,"offset":0}},"content":"e","isStatic":false,"constType":0},"modifiers":[],"loc":{"start":{"column":11,"line":9,"offset":428},"end":{"column":34,"line":9,"offset":451},"source":"v-html=\"state.thisHtml\""}}
- 发布:2022-01-15 18:45
- 更新:2022-03-28 15:13
- 阅读:3079
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.3.5
第三方开发者工具版本号: 1.05.2112301
基础库版本号: 2.21.3
项目创建方式: HBuilderX
示例代码:
操作步骤:
<view class="introduce" id="introduce-main" :style="{minHeight: deviceHeight + 'px'}">
<view v-html="state.thisHtml" class="intruction-content" v-show="state.selected === 'intruction'"></view>
<view v-html="state.thisParam" class="param-content" v-show="state.selected === 'param'"></view>
</view>
<view class="introduce" id="introduce-main" :style="{minHeight: deviceHeight + 'px'}">
<view v-html="state.thisHtml" class="intruction-content" v-show="state.selected === 'intruction'"></view>
<view v-html="state.thisParam" class="param-content" v-show="state.selected === 'param'"></view>
</view>
预期结果:
微信小程序可以编译通过编译
微信小程序可以编译通过编译
实际结果:
微信小程序无法编译相关指令
微信小程序无法编译相关指令
bug描述:
@dcloudio/vite-plugin-uni 版本是最新的,微信小程序开发不支持v-bind 和 v-html,尤其是v-html,这是个比较重要的属性
DCloud_UNI_FXY
稍后v-html会自动编译为rich-text节点
2022-01-15 20:59