微信小程序:import导入公共文件方式

wxss:

@import "../common/ali_icon.wxss";

wxml:

公共文件(位置:../common/head.wxml)如下----

<template name="head">456</template>  //不会被导入

<template name="head2">789</template>   //会被导入
<!--wxml页面导入-->
<import src="../common/head.wxml"/>
<template is="head2"></template>
 

原文地址:https://www.cnblogs.com/two-bees/p/10458193.html