resChange.js 372 B

1234567891011121314151617
  1. const resChange = {
  2. install (vue) {
  3. vue.prototype.$resChange = function (data, msg) {
  4. if (data.errcode !== 0) {
  5. this.$message.error(data.errmsg);
  6. return;
  7. }
  8. if (data.errcode == 0 || !data.errcode) {
  9. this.$message({
  10. message: msg,
  11. type: 'success'
  12. });
  13. }
  14. };
  15. }
  16. };
  17. export default resChange;