You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

5 years ago
  1. global.domino = null
  2. global.window = null
  3. global.document = null
  4. global.location = null
  5. global.Vue = null
  6. global.VueRouter = null
  7. global.axios = null
  8. navigator = null
  9. require("./dist/index")
  10. var html = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Title</title>\n</head>\n<body>\n<div id=\"classifyer\">\n code : {{code}}\n <li v-for=\"todo in data\">\n classifyer_id :{{ todo.classifyer_id }}\n name :{{ todo.name }}\n </li>\n</div>\n</body>\n</html>"
  11. window = domino.createWindow(html, "http://127.0.0.1/#/detail/?id=123");
  12. document = window.document;
  13. location = window.location;
  14. var vue = new Vue({
  15. el: "#classifyer",
  16. data: function(){
  17. return {
  18. code: 212123213123,
  19. data: [
  20. { name: "1asdasdasd23" }
  21. ]
  22. }
  23. }
  24. });
  25. console.log(document.innerHTML);
  26. Vue.axios.get('/user', {
  27. params: {
  28. ID: 12345
  29. }
  30. })
  31. .then(function (response) {
  32. console.log(response);
  33. })
  34. .catch(function (error) {
  35. console.log(error);
  36. })
  37. .then(function () {
  38. // always executed
  39. });