Skip to content

Commit 4a4c440

Browse files
posvayyx990803
authored andcommitted
Add version variable to VueRouter (#991)
Fixes #978 Closes #979
1 parent 3d53612 commit 4a4c440

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

build/build.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ function genConfig (opts) {
6666
flow(),
6767
node(),
6868
cjs(),
69+
replace({
70+
__VERSION__: version
71+
}),
6972
buble()
7073
]
7174
}

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { normalizeLocation } from './util/location'
1212

1313
export default class VueRouter {
1414
static install: () => void;
15+
static version: string;
1516

1617
app: any;
1718
options: RouterOptions;
@@ -155,6 +156,7 @@ function createHref (base: string, fullPath: string, mode) {
155156
}
156157

157158
VueRouter.install = install
159+
VueRouter.version = '__VERSION__'
158160

159161
if (inBrowser && window.Vue) {
160162
window.Vue.use(VueRouter)

0 commit comments

Comments
 (0)