Import methods that need to be paid attention to when Vue introduces plugins

Insert picture description here

These days when I introduced the plug-in type in the Vue project, the initialization code was written, but the console kept reporting me an error: The function name is not defined, because my plug-in was not introduced at all, which made it impossible to use the corresponding api, the following are my two correct and incorrect writing methods:
❌Wrong writing: import'@/components/keyboard/cpic-keyboard.js'
✅Correct writing: import {cpicKeyboard} from'@/components/keyboard/cpic-keyboard. js'

This wording is related to the specific wording of the imported file, so when you encounter this kind of error, you might as well try the second wording to solve the error. The following figure is the correct wording:
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_39380337/article/details/105344886