Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
800 views
in Technique[技术] by (71.8m points)

typescript - iconSet[key].split is not a function

I'm writing a Vue.js application using ts and Vuetify. I want to add a new prototype to all objects.

declare global {
  interface Object {
    toOneObject(): object;
  }
}

export default () => {
  Object.prototype.toOneObject = function () {
    return this
  }
}

As soon as I import it no matter where, an error occurs in Vuetify.

Uncaught TypeError: iconSet[key].split is not a function
at convertToComponentDeclarations (fa-svg.js?1845:9)
at eval (fa-svg.js?1845:16)
at Module../node_modules/vuetify/lib/services/icons/presets/fa-svg.js (chunk-vendors.js:8658)
at __webpack_require__ (app.js:854)
at fn (app.js:151)
at eval (index.js?6eb1:1)
at Module../node_modules/vuetify/lib/services/icons/presets/index.js (chunk-vendors.js:8694)
at __webpack_require__ (app.js:854)
at fn (app.js:151)
at eval (index.js?2e02:1)

I don't quite understand how this error occurs and how it is related. Before that I made a prototype for all arrays and it works fine


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...