将VueJS2与vue-resource一起使用
构建处理CRUD函数的特征。
我的模型数据存储在key selectedClientModel(例如)中的数据中,因此,使用此Trait的组件定义了存储数据的键,即>>
this.resourceUri = "/api/admin/clients";
并适当设置resourceUri。即>>
updateModel() {
var vm = this;
var model = this.$data[this.dataModel];
this.$http.put(this.resourceUri + '/' + model.id, model).then(function(response) {
alert('success');
}, function (response) {
alert('failure');
});
},
所以,特质低于.....
InternalError: too much recursion
Stack trace:
reactiveGetter@http://oriondas.app/js/retailer-orders.js line 103 > eval:1101:11
_merge@http://oriondas.app/js/retailer-orders.js line 230 > eval:413:1
_merge@http://oriondas.app/js/retailer-orders.js line 230 > eval:420:13
_merge@http://oriondas.app/js/retailer-orders.js line 230 > eval:420:13
...
当我运行它时,chrome崩溃了,所以我为Devs安装了FF并找到了以下内容:
eval("/*!\n * Vue.js v2.0.3\n * (c) 2014-2016 Evan You\n * Released under the MIT License.\n */\n(function (global, factory) {\n true ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.Vue = fac .......
第103行是:
eval("/*!\n * vue-resource v1.0.3\n * https://github.com/vuejs/vue-resource\n * Released under the MIT License.\n */\n\n'use strict';\n\n/**\n * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)\n */\n\nvar RESOLVED = 0;\nvar REJECTED = 1;\nvar PENDING = 2;\n\nfunction Promise$1(executor) {\n\n this.state = PENDING;\n this.value = undefined;\n this.deferred = [];\n\n var promise = this;\n\n try {\n executor(function (x) {\n promise.resolve(x);\n }, fu .....
第230行是:
<web-app>...
<resource-ref>
<description>My database</description>
<res-ref-name>jdbc/xxx</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
我不知道为什么会变成一个无限循环......任何帮助都会非常感激。
(仅供参考,我使用Vue-resource进行创建和删除,它们的工作非常合适......)