-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Expand file tree
/
Copy pathprogram.ts
More file actions
46 lines (39 loc) · 1012 Bytes
/
program.ts
File metadata and controls
46 lines (39 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { TaroPlatformBase } from '@tarojs/service'
import { components } from './components'
import { Template } from './template'
const PACKAGE_NAME = '@tarojs/plugin-platform-jd'
export default class JD extends TaroPlatformBase {
platform = 'jd'
globalObject = 'jd'
projectConfigJson = 'project.jd.json'
taroComponentsPath = `${PACKAGE_NAME}/dist/components-react`
runtimePath = `${PACKAGE_NAME}/dist/runtime`
fileType = {
templ: '.jxml',
style: '.jxss',
config: '.json',
script: '.js',
xs: '.jds'
}
template = new Template()
/**
* 1. setupTransaction - init
* 2. setup
* 3. setupTransaction - close
* 4. buildTransaction - init
* 5. build
* 6. buildTransaction - close
*/
constructor (ctx, config) {
super(ctx, config)
this.setupTransaction.addWrapper({
close: this.modifyTemplate
})
}
/**
* 增加组件或修改组件属性
*/
modifyTemplate () {
this.template.mergeComponents(this.ctx, components)
}
}