template怎么动态改变引入路径?

发布于 6 年前作者 plei7093 次浏览最后编辑 6 年前来自 ask

src 动态引入会报 WXMLRT_$gwx:./pages/index/index.wxml:import:8:6: Path `{{item.link}}` not found from `./pages/index/index.wxml`.

代码如下:

<block wx:for=‘{{data}}’ wx:key=‘{{item.name}}’>

<import src=‘{{item.link}}’/>

<template is=“{{item.name}}” data=“{{…item}}”></template>

</block>

1 回复
shaoyong
shaoyong1 楼5 年前

不能。