Forum

VUE.JS - default va...
 
Notifications
Clear all

VUE.JS - default value from attr?

1 Posty
1 Users
0 Likes
1,416 Widok
0
Topic starter

how to set initial value of data

1 Answer
0
Topic starter

workaround, approach 1.

1
2
3
4
    data: {
        myVar1: parseInt(document.querySelector("input[name=value]").value),
        myVar2: parseInt(document.querySelector("#idOfMyObject").getAttribute("atrributeName")),
    },
    data: {
        myVar1: parseInt(document.querySelector("input[name=value]").value),
        myVar2: parseInt(document.querySelector("#idOfMyObject").getAttribute("atrributeName")),
    },

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: