1// @ts-nocheck 2// Usage: 3// ------ 4// <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.0/axios.min.js" defer></script> 5// <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js" defer></script> 6 7(function (document, Vue, axios) { 8 9 document 10 .querySelectorAll('[nav-item-user]') 11 .forEach(function (form) { 12 13 new Vue({ 14 el: form, 15 data: function () { 16 return { 17 isAuthenticated: false, 18 user: { 19 firstName: '', 20 lastName: '' 21 } 22 }; 23 }, 24 mounted: function () { 25 26 var _this = this; 27 28 axios 29 .get('/user/api/me') 30 .then(function (response) { 31 32 var user = response.data; 33 34 _this.user.firstName = user.firstName; 35 _this.user.lastName = user.lastName; 36 _this.isAuthenticated = true; 37 38 }); 39 40 } 41 }); 42 43 }); 44 45})(document, window.Vue, window.axios);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.