This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDOMPath(element) { | |
var path = '', i, tag, selector, className, childIndex, childrenOfParent; | |
for (; element && element.nodeType == 1; element = element.parentNode) { | |
tag = element.tagName.toLowerCase(); | |
className = element.className.trim(); | |
childrenOfParent = $(element.parentNode).children(); | |
childIndex = childrenOfParent.length > 1 ? (childrenOfParent.index(element) + 1) : null; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import qs from 'qs'; | |
// Customized Axios object for API calls | |
var Api = axios.create({ | |
// NOTE: Replace the API URL | |
baseURL: 'http://api.example.com/', | |
responseType: 'json', | |
withCredentials: true | |
// Add whatever you want to configure Axios here |