微信小程序 模擬加載請求數據(六)

alt+shift+f:格式化快捷方式 新建一個data文件,posts-data.js,給腳本文件定義出口module.exports = {postList:local_database//數組名} 在posts.js裏引用:var postData = require('../../posts-data.js');//只能用相對路徑 如果要在多個頁面用相同的模板,使用template, 引入
相關文章
相關標籤/搜索