zoukankan      html  css  js  c++  java
  • 小程序 <include >

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

    使用

    <include  src="../template/template.wxml"/>  
    <!--在使用的页面-->
    
    <view class='contact' style='100%;height:100rpx'>
     <view  style='50%;float:left;height:100rpx;background:rgba(250,250,250,0.6);padding-top:20rpx'  bindtap="makePhoneCall" >
        <view style='float:left;margin-left:60rpx;'>
           <image style='70rpx;height:70rpx' src="../../resourse/img/phone.png"></image>
         </view>
         <view style='float:left'>
            <view style='font-size:12px;height:35rpx;line-height:35rpx;color:#707070;'>专属热线</view>
            <view style='font-size:12px;height:35rpx;line-height:35rpx;color:#707070'>{{mobile}}</view>
         </view>
     </view>
     <view   style='50%;float:left;height:100rpx;background:rgba(255,0,0,0.6);padding-top:20rpx;text-align:center'>
            <contact-button 
            type="default-light" 
            size="27"
            session-from="weapp" style='100%;height:100%;font-szie:12px;color:#fff'>
              联系我们
            </contact-button>
     </view>
    </view>
    <!--被引用的页面-->

    可以看出在被引用的页面里面是没有<template>标签的

    include的模板数据也是写在引用的页面里面的,这一点和import是一样的

      

  • 相关阅读:
    [SCOI2010]连续攻击游戏
    [SCOI2010]幸运数字
    SCOI2010第一场
    Asm.Def谈笑风生
    商务旅行
    [NOI2000] 单词查找树
    [HNOI2004] L语言
    于是他错误的点名开始了
    字典
    [SDOI2015]星际战争
  • 原文地址:https://www.cnblogs.com/zhangweihu/p/7598089.html
Copyright © 2011-2022 走看看