这几天在做微信小程序 ---
总是忘记该如何跨文件去引用 js html css
记一下
html
需要定义模板 A文件
<template name="list"></template> 记得命名
B文件引用
<import src="A文件的路径" /> 这里记得闭合标签
<template is="list"></template> list为名字 如果需要循环的话记得在外面包个东西 然后 wx:for = {{你要循环的数组}}
eg:<import src="../../utils/listdlc/listdlc.wxml" />
<view wx:for="{{dlc}}" wx:key="2" >
<template is="list" data="{{...item}}"></template>
css
头部 @import “要引用的css路径”
js
var xxx = require(’引用的js路径‘)
url: '../gamevideo/gamevideo?id='+this.data.id 用页面url传参还是要注意? 这个符号