为什么模板不能引用

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

<!–index.wxml–>

<!–引入模板–>

<import scr=“…/common/common” />

<view class=“container”>

  <!–编写输入框–>

  <view class=“header”>

    <input class=“search” placeholder=“{{subTitle}}” placeholder-class=“search-placeholder” bindchange=“handleSearch” auto-focus=“true” />

  </view>

  <template is=“movies-list” data=“{{movies}}”></template>

</view>

<!–common.wxml–>

<template name=“movies-list”>

  <scroll-view scroll-y=“true” class=“list”>

    <template is=“item1” data=“{{item}}” wx:for=“{{movies}}” wx:key=“id”></template>

  </scroll-view>

</template>

1 回复
tanjuan
tanjuan1 楼4 年前

模版可以被import。请检查模板路径是否填写正确,控制台是否有warning