| 1264 | }; |
| 1265 | |
| 1266 | function plugin(Vue) { |
| 1267 | |
| 1268 | if (plugin.installed) { |
| 1269 | return; |
| 1270 | } |
| 1271 | |
| 1272 | Util(Vue); |
| 1273 | |
| 1274 | Vue.url = Url; |
| 1275 | Vue.http = Http; |
| 1276 | Vue.resource = Resource; |
| 1277 | Vue.Promise = Promise$1; |
| 1278 | |
| 1279 | Object.defineProperties(Vue.prototype, { |
| 1280 | |
| 1281 | $url: { |
| 1282 | get: function () { |
| 1283 | return options(Vue.url, this, this.$options.url); |
| 1284 | } |
| 1285 | }, |
| 1286 | |
| 1287 | $http: { |
| 1288 | get: function () { |
| 1289 | return options(Vue.http, this, this.$options.http); |
| 1290 | } |
| 1291 | }, |
| 1292 | |
| 1293 | $resource: { |
| 1294 | get: function () { |
| 1295 | return Vue.resource.bind(this); |
| 1296 | } |
| 1297 | }, |
| 1298 | |
| 1299 | $promise: { |
| 1300 | get: function () { |
| 1301 | var _this = this; |
| 1302 | |
| 1303 | return function (executor) { |
| 1304 | return new Vue.Promise(executor, _this); |
| 1305 | }; |
| 1306 | } |
| 1307 | } |
| 1308 | |
| 1309 | }); |
| 1310 | } |
| 1311 | |
| 1312 | if (typeof window !== 'undefined' && window.Vue) { |
| 1313 | window.Vue.use(plugin); |