Vuetify: [Bug Report] v-btn default target

Created on 11 Sep 2018  路  5Comments  路  Source: vuetifyjs/vuetify

Versions and Environment

Vuetify: 1.2.2
Vue: 2.5.2
Browsers: Chrome, Safari
OS: Windows 10, Windows, Android, iOS

Steps to reproduce
Add v-btn element with href : <v-btn class="primary-btn" :href="/" >Button</v-btn>

Expected Behavior
If target attribute not specified, default attribute should be "_self", "undefined" instead.

image

Actual Behavior
If target attribute not specified, link will be opened randomly (new window or same window)

Note
In vuetify source code "src/components/VBtn/VBtn.ts", missing props for target attribute such as:

props: {
...
    target: {
      type: String,
      default:  '_self'
    },
...
}

Most helpful comment

I had the same issue. I think that it is better that default is set as _self.

All 5 comments

I had the same issue. I think that it is better that default is set as _self.

Same here.

Why?

link will be opened randomly

No it won't, it'll be opened like every other link based on the browser's settings. Put <base target="_self" /> in your \

Override what? Opening in a random window?

It does exactly what you're asking for here - adds target to every link on the page.

  • The current behaviour is not a bug
  • This change would result in the exact unexpected behaviour that you are talking about
  • If your browser is opening links "randomly" then you have some other problem going on that is not related to vuetify
  • We will not be making this change
Was this page helpful?
0 / 5 - 0 ratings