Why is my global reference to the mint-ui framework invalid?

install module:

npm install mint-ui -S

mains.js:

import Mint from "mint-ui";
import "mint-ui/lib/style.css"
Vue.use(Mint);

I want to use the toash component now
using the toash component in xx.vue he will prompt that he cannot find
if I add this sentence: import {Toast} from "mint-ui" you can

Q:
but I have already referenced it globally in main.js. Why do I have to quote it locally once

?

multiple import, will only be introduced once, don't worry. As for why you have to import, many times or there are no variable references, you must have reported an error.


you are right to write this, but individual ones such as toast, Indicator, etc. (those that do not need to be Vue.use (xxx) on the page) need to be introduced separately, or you can directly this.$toast ({})

.
Menu