- 绝对路径&相对路径
绝对路径是从根目录开始找 写法如下,在根目录下的文件名以 / 开头
"usingComponents": {
"w-like":"/components/like/index"
}
}
相对路径,是相对于要使用的这个文件的目录,被引用的文件路径,如下
{
"usingComponents": {
"w-like":"../../components/like/index"
}
}
使用哪种方式,取决于哪个方便
- template模板使用
在一个page里写完wxml.wxss
在需要使用的页面分别引入wxml和wxss
<wxs module="filter" src="/pages/index.wxs"></wxs>
网友评论