messageService
如果在开发中要引用messageService服务,首先需要在config.json中的services中增加配置, 其次要在main.js或用户自己的创建的其他js文件中,引用该插件。
示例:
{
"develop":{
"html":"index.html",
"css":["./index.css"],
"entry":"./main.js",
"scripts":{
}
},
"plugins":[],
"libs":[],
"services":["messageService"],
"customAttributes":{
"pro":[
]
}
}
(function(){
return {
$data:{
properties:null
},
$methods:{
},
$hookds:{
onInit(properties){
var messageService=window.services.messageService;
messageService.create('success', '调用成功' )
}
}
}
})
该service来自ant.design,相关API方法请参考 https://ng.ant.design/version/0.7.x/components/message/zh