a couple more components started

pull/1/head
Braydon Kains 6 years ago
parent 94e9f41803
commit b6cdb63cd2

343
public/js/app.js vendored

@ -1752,6 +1752,106 @@ module.exports = {
};
/***/ }),
/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js&":
/*!********************************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js& ***!
\********************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["default"] = ({
props: ['user_id'],
data: function data() {
return {
thread_title: '',
edit: true
};
},
methods: {
createThread: function createThread() {
var _this = this;
fetch("api/thread/store", {
method: "post",
body: {
thread_title: this.thread_title,
user_id: this.user_id
},
headers: {
'content-type': 'application/json'
}
}).then(function (res) {
return res.json;
}).then(function (data) {
_this.thread_title = '';
alert("it might have worked");
}).catch(function (err) {
return console.log(err);
});
}
}
});
/***/ }),
/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&":
/*!*****************************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js& ***!
\*****************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["default"] = ({
data: function data() {
return {
tags: [],
tag: {
id: '',
tag_text: ''
}
};
},
created: function created() {
this.fetchTags();
},
methods: {
fetchTags: function fetchTags() {
var _this = this;
fetch("api/tags").then(function (res) {
return res.json();
}).then(function (res) {
_this.tags = res.data;
});
}
}
});
/***/ }),
/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&":
@ -36831,6 +36931,109 @@ exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c&":
/*!************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c& ***!
\************************************************************************************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"form",
{
staticClass: "mb-3",
on: {
submit: function($event) {
$event.preventDefault()
return _vm.createThread($event)
}
}
},
[
_c("div", { staticClass: "form-group" }, [
_c("input", {
directives: [
{
name: "model",
rawName: "v-model",
value: _vm.thread_title,
expression: "thread_title"
}
],
staticClass: "form-control",
attrs: { type: "text", placeholder: "Title" },
domProps: { value: _vm.thread_title },
on: {
input: function($event) {
if ($event.target.composing) {
return
}
_vm.thread_title = $event.target.value
}
}
})
]),
_vm._v(" "),
_vm._m(0)
]
)
}
var staticRenderFns = [
function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("div", { staticClass: "form-group" }, [
_c("button", { staticClass: "btn btn-light", attrs: { type: "submit" } })
])
}
]
render._withStripped = true
/***/ }),
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&":
/*!*********************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292& ***!
\*********************************************************************************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"div",
_vm._l(_vm.tags, function(tag) {
return _c("div", { key: tag.id, staticClass: "card card-body" }, [
_c("p", [_vm._v(_vm._s(tag.tag_text))])
])
}),
0
)
}
var staticRenderFns = []
render._withStripped = true
/***/ }),
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&":
@ -49035,6 +49238,8 @@ window.Vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
Vue.component('thread-component', __webpack_require__(/*! ./components/ThreadComponent.vue */ "./resources/js/components/ThreadComponent.vue").default);
Vue.component('tag_selector', __webpack_require__(/*! ./components/TagSelectComponent.vue */ "./resources/js/components/TagSelectComponent.vue").default);
Vue.component('thread-create-form', __webpack_require__(/*! ./components/CreateThreadComponent.vue */ "./resources/js/components/CreateThreadComponent.vue").default);
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
@ -49103,6 +49308,144 @@ if (token) {
// encrypted: true
// });
/***/ }),
/***/ "./resources/js/components/CreateThreadComponent.vue":
/*!***********************************************************!*\
!*** ./resources/js/components/CreateThreadComponent.vue ***!
\***********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CreateThreadComponent.vue?vue&type=template&id=69e9049c& */ "./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c&");
/* harmony import */ var _CreateThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CreateThreadComponent.vue?vue&type=script&lang=js& */ "./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js&");
/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
/* normalize component */
var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
_CreateThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
_CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__["render"],
_CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
false,
null,
null,
null
)
/* hot reload */
if (false) { var api; }
component.options.__file = "resources/js/components/CreateThreadComponent.vue"
/* harmony default export */ __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js&":
/*!************************************************************************************!*\
!*** ./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js& ***!
\************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./CreateThreadComponent.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js&");
/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c&":
/*!******************************************************************************************!*\
!*** ./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c& ***!
\******************************************************************************************/
/*! exports provided: render, staticRenderFns */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./CreateThreadComponent.vue?vue&type=template&id=69e9049c& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c&");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__["render"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
/***/ }),
/***/ "./resources/js/components/TagSelectComponent.vue":
/*!********************************************************!*\
!*** ./resources/js/components/TagSelectComponent.vue ***!
\********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TagSelectComponent.vue?vue&type=template&id=6b77d292& */ "./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&");
/* harmony import */ var _TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TagSelectComponent.vue?vue&type=script&lang=js& */ "./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&");
/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
/* normalize component */
var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
_TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["render"],
_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
false,
null,
null,
null
)
/* hot reload */
if (false) { var api; }
component.options.__file = "resources/js/components/TagSelectComponent.vue"
/* harmony default export */ __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&":
/*!*********************************************************************************!*\
!*** ./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js& ***!
\*********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./TagSelectComponent.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&");
/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&":
/*!***************************************************************************************!*\
!*** ./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292& ***!
\***************************************************************************************/
/*! exports provided: render, staticRenderFns */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./TagSelectComponent.vue?vue&type=template&id=6b77d292& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["render"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
/***/ }),
/***/ "./resources/js/components/ThreadComponent.vue":

@ -21,6 +21,8 @@ window.Vue = require('vue');
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
Vue.component('thread-component', require('./components/ThreadComponent.vue').default);
Vue.component('tag_selector', require('./components/TagSelectComponent.vue').default);
Vue.component('thread-create-form', require('./components/CreateThreadComponent.vue').default);
/**
* Next, we will create a fresh Vue application instance and attach it to

@ -0,0 +1,44 @@
<template>
<form @submit.prevent="createThread" class="mb-3">
<div class="form-group">
<input type="text" class="form-control" placeholder="Title" v-model="thread_title">
</div>
<div class="form-group">
<button type="submit" class="btn btn-light"></button>
</div>
</form>
</template>
<script>
export default {
props: ['user_id'],
data() {
return {
thread_title: '',
edit: true
}
},
methods: {
createThread() {
fetch("api/thread/store", {
method: "post",
body: {
thread_title: this.thread_title,
user_id: this.user_id
},
headers: {
'content-type': 'application/json'
}
})
.then(res => res.json)
.then(data => {
this.thread_title = '';
alert("it might have worked");
})
.catch(err => console.log(err));
}
}
}
</script>

@ -1,23 +0,0 @@
<template>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Example Component</div>
<div class="card-body">
I'm an example component.
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
mounted() {
console.log('Component mounted.')
}
}
</script>

@ -0,0 +1,35 @@
<template>
<div>
<div class="card card-body" v-for="tag in tags" v-bind:key="tag.id">
<p>{{ tag.tag_text }}</p>
</div>
</div>
</template>
<script>
export default {
data() {
return {
tags: [],
tag: {
id: '',
tag_text: ''
}
}
},
created() {
this.fetchTags();
},
methods: {
fetchTags() {
fetch("api/tags")
.then(res => res.json())
.then(res => {
this.tags = res.data;
});
}
}
}
</script>

Binary file not shown.
Loading…
Cancel
Save