美文网首页
引用import和include

引用import和include

作者: 阿彤呀呀 | 来源:发表于2018-12-17 09:38 被阅读0次

    (一)import

    import可以在该文件中使用目标文件定义的template

        在item.wxml中定义了一个叫item的template:
        在index.wxml中引用了item.wxml,就可以使用item模板:
        <import src="item.wxml"/>
        <template is="item" data="{{text: 'forbar'}}"/>
    

    (二)include

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

    相关文章

      网友评论

          本文标题:引用import和include

          本文链接:https://www.haomeiwen.com/subject/wzqqkqtx.html