--- /dev/null
+/* commentst.js */
+const comments = {};
+var vm;
+
+Vue.component('comment-node', {
+ template: '#comment-node-template',
+ props: ["comments",],
+ //props: {comments: Object,},
+});
+
+comments.run = function run (params) {
+ const data = {
+ type: params.type,
+ stoid: params.stoid,
+ sid: params.sid,
+ discussion_id: params.discussion_id,
+ comments: params.comments,
+ };
+
+ const computed = {};
+ const methods = {};
+ const endPoint = "/api/v1/comment?discussion_id=" + data.discussion_id;
+
+ vm = new Vue({el: params.el,
+ data: data,
+ computed: computed,
+ methods: methods,
+ created: function () {
+ this.$http.get(endPoint).then(
+ (resp) => { // success
+ this.comments = resp.body.comments;
+ },
+ (resp) => { // fail
+ }
+ );
+ },
+ });
+};