我总是收到错误消息,指出createTabs显然不是函数。我在做什么错了?
我尝试重命名变量,然后在其他已设置的变量中未定义。
const createTabs = document.querySelector('.tabs')
console.log('Yooo', createTabs)
axios.get('https://lambda-times-backend.herokuapp.com/topics')
.then((data) =>{
// gives results from the server
console.log('response', data)
let tabs = data.data
console.log('Yooo', tabs)
const element =createTabs(tabs)
console.log('Rip Nip the Great', tabs)
tabs.appendChild(element)
})
.catch((error) => {
console.log('Error', error);
})
Error TypeError: createTabs is not a function
at index.js:21