1234567891011121314151617181920212223242526272829303132333435363738 |
- new Vue({
- el: "#main",
- data: {
- info: ""
- },
- mounted: function() {
- this.info = JSON.stringify({
- hospitalId: this.getRequest("hospitalId"),
- hosName: this.getRequest("hosName")
- });
- this.bindEvents();
- },
- methods: {
- bindEvents: function() {
- EventBus.$emit("jump-step", {
- step: 1
- }); //step: 跳转的步数
- },
- getRequest: function(name) {
- var url = window.location.href; //获取地址栏url
- var pattern = new RegExp("[?&]" + name + "\=([^&]+)", "g");
- var matcher = pattern.exec(url);
- var items = null;
- if(null != matcher) {
- try {
- items = decodeURIComponent(decodeURIComponent(matcher[1]));
- } catch(e) {
- try {
- items = decodeURIComponent(matcher[1]);
- } catch(e) {
- items = matcher[1];
- }
- }
- }
- return items;
- }
- }
- })
|