@itfin/components 1.0.94 → 1.0.97

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itfin/components",
3
- "version": "1.0.94",
3
+ "version": "1.0.97",
4
4
  "main": "dist/itfin-components.umd.js",
5
5
  "unpkg": "dist/itfin-components.common.js",
6
6
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
@@ -2,15 +2,14 @@
2
2
 
3
3
  <nuxt-link
4
4
  @click.native="$emit('click', $event)"
5
- :disabled="disabled"
6
5
  class="itf-button btn"
7
6
  tabindex="0"
8
7
  type="button"
8
+ :to="toLink"
9
+ :disabled="disabled"
10
+ :target="target"
9
11
  :tag="isLink ? 'a' : 'button'"
10
- :href="href"
11
12
  :event="isLink ? 'click' : []"
12
- :to="to || {}"
13
- :target="target"
14
13
  :class="{
15
14
  [`btn-${color}`]: color,
16
15
  'itf-button__block': block,
@@ -166,6 +165,15 @@ class itfButton extends Vue {
166
165
  @Prop(String) href;
167
166
  @Prop(String) target;
168
167
 
168
+ get toLink() {
169
+ if (this.to) {
170
+ return this.to || {};
171
+ } else if (this.href) {
172
+ return { path: this.href };
173
+ }
174
+ return {};
175
+ }
176
+
169
177
  get isLink() {
170
178
  return this.href || this.to;
171
179
  }