使用vant-weapp Dialog时,报错“未找到 van-dialog 节点,请确认 selector 及 context 是否正确”
.json文件中导入
"usingComponents": {"van-dialog": "@vant/weapp/dialog/index"}
.wxml中使用
.js中使用
//官网中设置的路径会报错
import Dialog from '../../miniprogram_npm/@vant/weapp/dialog/dialog';openDialog: function() {Dialog.confirm({//如果不设置selecter时,会报标题中的错误信息// context: this,selector:'#myDialog',title: '标题',message: '弹窗内容',}).then((res) => {console.log('openDialog',res)}).catch((error)=> {console.log('openDialog error',error)})}
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
