How to use the symbol reference method of iconfont in vue-cli

has been using vue-cli as a project recently, and the symbol reference recommended by the Ali icon library cannot be used directly in the project. Looking at the iconfont.js file, it is found that it is an anonymous immediate execution function

clipboard.png

,export

clipboard.png

,createdmounted

clipboard.png

clipboard.png

the icon can be displayed normally in this way, but it always feels weird. Excuse me, is this the correct posture? Is there a better solution?


if you really introduce svg in the native way, you can specifically maintain a vue component of the svg symbol tag, and then add it to the page at the entrance, such as main.vue. You can use symbol as long as you throw the svg tag into the page. If you still find it troublesome to write < svg > < use xxx >, you can also write this as a dynamic component, as shown below

.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea17c3-1b61.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea17c3-1b61.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?