在 js 中直接导入 import Toast from '@vant/weapp/toast/toast'; 编写 Toast 会报告警,如图所示 解决办法,是在对应的 wxml 文件中加入代码 <van-toast id="van-toast" /> 即可解决问题。