Skip to content

Commit 2254635

Browse files
authored
fix: update $x logic to avoid plugin error (#2429)
1 parent 4f45012 commit 2254635

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ class Dayjs {
8686
constructor(cfg) {
8787
this.$L = parseLocale(cfg.locale, null, true)
8888
this.parse(cfg) // for plugin
89+
this.$x = this.$x || cfg.x || {}
8990
this[IS_DAYJS] = true
9091
}
9192

9293
parse(cfg) {
9394
this.$d = parseDate(cfg)
94-
this.$x = cfg.x || {}
9595
this.init()
9696
}
9797

0 commit comments

Comments
 (0)