Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6389774

Browse files
committed
add VueJS global config support
1 parent 7dd2d36 commit 6389774

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

‎extra.go‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
package vue
22

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+
324
// Vue.partial( id, [definition] )
425
// id String
526
// definition String | Node optional
@@ -49,3 +70,9 @@ func Set(obj, key, value interface{}) {
4970
func Delete(obj, key interface{}) {
5071
vue.Call("delete", obj, key)
5172
}
73+
74+
var Config = &TConfig{}
75+
76+
func init() {
77+
Config.Object = vue.Get("config")
78+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /