Skip to content

Commit 843683e

Browse files
author
User
committed
added Options/Assets APIs
1 parent c3b6706 commit 843683e

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed

API.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const G_API = require('./apis/globalapi')
33
const O_D = require('./apis/optionsdata')
44
const O_DOM = require('./apis/optionsdom')
55
const O_LH = require('./apis/optionslifecyclehooks')
6+
const O_A = require('./apis/optionsassets')
67

78
const GlobalConfig = [
89
G_C.SILENT,
@@ -60,11 +61,18 @@ const OptionsLifecycleHooks = [
6061

6162
]
6263

64+
const OptionsAssets = [
65+
O_A.DIRECTIVES,
66+
O_A.FILTERS,
67+
O_A.COMPONENTS
68+
]
69+
6370

6471
module.exports = {
6572
GlobalConfig,
6673
GlobalAPI,
6774
OptionsData,
6875
OptionsDOM,
69-
OptionsLifecycleHooks
76+
OptionsLifecycleHooks,
77+
OptionsAssets
7078
}

apis/optionsassets.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const chalk = require('chalk')
2+
const custom = require('../customcolors')
3+
const colorComment = custom.colorComment
4+
const colorPrimitive = custom.colorPrimitive
5+
const colorError = custom.colorError
6+
const colorArgs = custom.colorArgs
7+
8+
const cat = 'Options/Assets'
9+
10+
const DIRECTIVES = {
11+
category: cat,
12+
name: 'directives',
13+
type: 'Object',
14+
details: `A hash of directives to be made available to the Vue instance.`
15+
}
16+
17+
const FILTERS = {
18+
category: cat,
19+
name: 'filters',
20+
type: 'Object',
21+
details: `A hash of filters to be made available to the Vue instance.`
22+
}
23+
24+
const COMPONENTS = {
25+
category: cat,
26+
name: 'components',
27+
type: 'Object',
28+
details: `A hash of components to be made available to the Vue instance.`
29+
}
30+
31+
32+
module.exports = {
33+
DIRECTIVES,
34+
FILTERS,
35+
COMPONENTS
36+
}

vue-help.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const ga = api.GlobalAPI
88
const od = api.OptionsData
99
const odom = api.OptionsDOM
1010
const olh = api.OptionsLifecycleHooks
11+
const oa = api.OptionsAssets
1112

1213
V.delimiter('vue-help$').show()
1314

@@ -259,4 +260,26 @@ V.command('destroyed', 'Options/Lifecycle Hooks: #destroyed').action(function(ar
259260
const w = olh[9]
260261
this.log(O.logOptions(w))
261262
callback()
262-
})
263+
})
264+
265+
// Options/Assets
266+
267+
V.command('directives', 'Options/Assets: #directives').action(function(args, callback){
268+
const w = oa[0]
269+
this.log(O.logOptions(w))
270+
callback()
271+
})
272+
273+
V.command('filters', 'Options/Assets: #filters').action(function(args, callback){
274+
const w = oa[1]
275+
this.log(O.logOptions(w))
276+
callback()
277+
})
278+
279+
V.command('components', 'Options/Assets: #components').action(function(args, callback){
280+
const w = oa[2]
281+
this.log(O.logOptions(w))
282+
callback()
283+
})
284+
285+
// Options/Composition

0 commit comments

Comments
 (0)