computed:
mapState({ socket: state => state.ws.socket }),
watch: {
socket: {
handler: function(val) {
if (this.$store.state.ws.socket.message.state === 'success') {
this.$notify({
title: '成功',
message: '短信发送成功',
type: 'success',
duration: 2000
})
}
},
deep: true
}
}
'$store.state.ws.socket.message.state': function() {
if (this.$store.state.ws.socket.message.state === 'success') {
this.$notify({
title: '成功',
message: '短信发送成功',
type: 'success',
duration: 2000
})
}
}