Skip to content

Commit e1d522b

Browse files
committed
Prefer bound title over static title attribute if present
1 parent 87a4adf commit e1d522b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/compiler/compile-props.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = function compileProps (el, propOptions) {
2121
var props = []
2222
var names = Object.keys(propOptions)
2323
var i = names.length
24-
var options, name, attr, value, path, parsed, prop
24+
var options, name, attr, value, path, parsed, prop, isTitleBinding
2525
while (i--) {
2626
name = names[i]
2727
options = propOptions[name] || empty
@@ -50,10 +50,16 @@ module.exports = function compileProps (el, propOptions) {
5050
mode: propBindingModes.ONE_WAY
5151
}
5252

53+
// IE title issues
54+
isTitleBinding = false
55+
if (name === 'title' && (el.getAttribute(':title') || el.getAttribute('v-bind:title'))) {
56+
isTitleBinding = true
57+
}
58+
5359
// first check literal version
5460
attr = _.hyphenate(name)
5561
value = prop.raw = _.attr(el, attr)
56-
if (value === null) {
62+
if (value === null || isTitleBinding) {
5763
// then check dynamic version
5864
if ((value = _.getBindAttr(el, attr)) === null) {
5965
if ((value = _.getBindAttr(el, attr + '.sync')) !== null) {

0 commit comments

Comments
 (0)