|
1 | 1 | package vue
|
2 | 2 |
|
| 3 | +import ( |
| 4 | + "github.com/gopherjs/gopherjs/js" |
| 5 | +) |
| 6 | + |
| 7 | +// TConfig is used for declaration only |
| 8 | +type TConfig struct { |
| 9 | + *js.Object |
| 10 | + // Suppress all Vue logs and warnings. |
| 11 | + Silent bool `js:"silent"` |
| 12 | + // The merge strategy receives the value of that option defined on the parent and child instances as the first and second arguments, respectively. |
| 13 | + OptionMergeStrategies interface{} `js:"optionMergeStrategies"` |
| 14 | + // Configure whether to allow vue-devtools inspection. |
| 15 | + Devtools bool `js:"devtools"` |
| 16 | + // Assign a handler for uncaught errors during component render and watchers. |
| 17 | + ErrorHandler func(err, vm *js.Object) `js:"errorHandler"` |
| 18 | + // Make Vue ignore custom elements defined outside of Vue (e.g., using the Web Components APIs). |
| 19 | + IgnoredElements []string `js:"ignoredElements"` |
| 20 | + // Define custom key alias(es) for v-on. |
| 21 | + KeyCodes map[string]int `js:"keyCodes"` |
| 22 | +} |
| 23 | + |
3 | 24 | // Vue.partial( id, [definition] )
|
4 | 25 | // id String
|
5 | 26 | // definition String | Node optional
|
@@ -49,3 +70,9 @@ func Set(obj, key, value interface{}) {
|
49 | 70 | func Delete(obj, key interface{}) {
|
50 | 71 | vue.Call("delete", obj, key)
|
51 | 72 | }
|
| 73 | + |
| 74 | +var Config = &TConfig{} |
| 75 | + |
| 76 | +func init() { |
| 77 | + Config.Object = vue.Get("config") |
| 78 | +} |
0 commit comments