core.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. 初始化处理
  3. **/
  4. (function(window, undefined){
  5. "use strict";
  6. var vc = window.vc || {};
  7. vc = {
  8. version:"v0.0.1",
  9. name:"vue component",
  10. author:'java110',
  11. component:new Vue()
  12. };
  13. var component = window.component || new Vue({
  14. methods:{
  15. }
  16. });
  17. //通知window对象
  18. window.vc = vc;
  19. })(window);
  20. /**
  21. vc 函数初始化
  22. add by wuxw
  23. **/
  24. (function(vc){
  25. vc.http = {
  26. call:function(componentCode,componentMethod,param,options,successCallback,errorCallback){
  27. console.log(successCallback)
  28. Vue.http.post('/callComponent/'+componentCode +"/"+componentMethod, param, options)
  29. .then(function(res){
  30. successCallback(res.bodyText,res);
  31. }, function(error){
  32. errorCallback(error.bodyText,error);
  33. });
  34. }
  35. };
  36. //绑定跳转函数
  37. vc.jumpToPage = function(url){
  38. window.location.href = url;
  39. };
  40. })(window.vc);