@worksafevictoria/wcl7.5 1.1.0-beta.79 → 1.1.0-beta.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/utility.js +7 -6
  2. package/package.json +1 -1
package/lib/utility.js CHANGED
@@ -37,20 +37,21 @@ function isGovSite(url) {
37
37
  function navigateToPath(path, newTab) {
38
38
  const url = String(path).startsWith('www.') ? `http://${path}` : path
39
39
  const isAbsolute = isAbsoluteUrl(url)
40
- if (!isAbsolute && this.$router && !newTab) {
41
- this.$router.push({
42
- path: url
40
+ const router = this?.$router ? this.$router : useRouter()
41
+ if (!isAbsolute && router && !newTab) {
42
+ router.push({
43
+ path: url,
43
44
  })
44
- } else if (!isAbsolute && this.$router && newTab) {
45
+ } else if (!isAbsolute && router && newTab) {
45
46
  const hrefTag = Object.assign(document.createElement('a'), {
46
47
  target: '_blank',
47
- href: url
48
+ href: url,
48
49
  })
49
50
  hrefTag.click()
50
51
  } else {
51
52
  const hrefTag = Object.assign(document.createElement('a'), {
52
53
  target: newTab ? '_blank' : '_self',
53
- href: url
54
+ href: url,
54
55
  })
55
56
  hrefTag.click()
56
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worksafevictoria/wcl7.5",
3
- "version": "1.1.0-beta.79",
3
+ "version": "1.1.0-beta.80",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {