How to use the components of vue in js

use the iview framework in the project. Now you want to do a prompt component for form validation, but you want to be able to use it in js. Message similar to iview

this.$Message.warn("....")

how to introduce components if you want to use them in this way.


const Message = Vue.extend(component)
const message = new Message().$mount() // body

Mount to the global @ lady plugin to learn about
Vue.prototype.$message = message


does not understand what your use in js means. If you want to use it in non-vue components, you can mount your js object to the vue instance


ide/plugins.html-sharp%E5%BC%80%E5%8F%91%E6%8F%92%E4%BB%B6" rel=" nofollow noreferrer "> https://cn.vuejs.org/v2/guide.

plug-ins to learn about

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-1e9edb1-1a0a.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-1e9edb1-1a0a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?