html52.com
我爱小程序-开发者交流社区

include 的文件中,找不到 Template 名

问题模块
API和组件

看文档

include可以将目标文件除了<template/>的整个代码引入,相当于是拷贝到include位置


我在 index.html 中 include 了 footer.wxml,

footer.wxml 中可以引用 index.js 中的 data,


然而 我在 index.html 中 定义了一个模板

<template name="name">
  <view>index中的模板</view>
</template>


然后在 footer.wxml 中 引用

<template is="name" />


预览的时候报

Template "name" not found.


include 中的模板也是有作用域?

网友回复

易:

已经在 index.wxml 中 <include src="footer.wxml"/> 了。

已经包含进去。

赵子龙:

没导入

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付