Commit 8fce12ac authored by wildfirecode13's avatar wildfirecode13

11

parent cf860e2e
No preview for this file type
# 流程
- 开发完毕后生成淘宝代码到/project/dist
- 合并必要的 dist 代码到/taobao 文件夹
# page
page 的 onload 需要手动修改,否则resList会无法正确获取
```js
onLoad(props) {
this.setData(this.data || {
resList: resList
});
}
```
改为
```js
onLoad(props) {
this.setData( {
resList: resList
});
}
```
# components
同样的components,onInit需要手动修改,否则resList会无法正确获取
```js
onInit(props) {
this.setData(this.data || {
resList: resList
});
}
```
# 其他
project/package.json 增加 build 和 start 两个 script
- project 下执行 npm start 进行 h5 环境调试
- project 下执行 npm run build 生成淘宝代码
{
"_from": "@tbmp/mp-cloud-sdk@^1.3.8",
"_args": [
[
"@tbmp/mp-cloud-sdk@1.4.2",
"/Users/wanghongyuan/hello_taobao/taobao"
]
],
"_from": "@tbmp/mp-cloud-sdk@1.4.2",
"_id": "@tbmp/mp-cloud-sdk@1.4.2",
"_inBundle": false,
"_integrity": "sha1-/49BtdDaNJ6H9+f9DDBMPgt/BbQ=",
"_location": "/@tbmp/mp-cloud-sdk",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "@tbmp/mp-cloud-sdk@^1.3.8",
"raw": "@tbmp/mp-cloud-sdk@1.4.2",
"name": "@tbmp/mp-cloud-sdk",
"escapedName": "@tbmp%2fmp-cloud-sdk",
"scope": "@tbmp",
"rawSpec": "^1.3.8",
"rawSpec": "1.4.2",
"saveSpec": null,
"fetchSpec": "^1.3.8"
"fetchSpec": "1.4.2"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npm.taobao.org/@tbmp/mp-cloud-sdk/download/@tbmp/mp-cloud-sdk-1.4.2.tgz",
"_shasum": "ff8f41b5d0da349e87f7e7fd0c304c3e0b7f05b4",
"_spec": "@tbmp/mp-cloud-sdk@^1.3.8",
"_where": "/Users/wanghongyuan/hello_taobao/project/dist",
"_spec": "1.4.2",
"_where": "/Users/wanghongyuan/hello_taobao/taobao",
"author": "",
"bundleDependencies": false,
"deprecated": false,
"description": "",
"gitHead": "c074f811312aea20c97a289aa9ac785e72de2368",
"license": "ISC",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment