61 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-11-16 10:21:14 +03:00
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./../../bootstrap');
import Vue from 'vue';
2020-01-03 12:10:07 +03:00
import DashboardPlugin from './../../plugins/dashboard-plugin';
2019-11-16 10:21:14 +03:00
import Global from './../../mixins/global';
import Form from './../../plugins/form';
import BulkAction from './../../plugins/bulk-action';
2020-01-03 12:10:07 +03:00
// plugin setup
2022-06-01 10:15:55 +03:00
Vue.use(DashboardPlugin);
2020-01-03 12:10:07 +03:00
2019-11-16 10:21:14 +03:00
const app = new Vue({
el: '#app',
mixins: [
2022-06-01 10:15:55 +03:00
Global,
2019-11-16 10:21:14 +03:00
],
data: function () {
return {
form: new Form('category'),
bulk_action: new BulkAction('categories'),
2022-06-01 10:15:55 +03:00
categoriesBasedTypes: null,
2022-12-13 10:37:05 +03:00
selected_type: true
2019-11-16 10:21:14 +03:00
}
},
methods: {
2022-06-01 10:15:55 +03:00
updateParentCategories(event) {
if (event === '') {
return;
}
if (typeof JSON.parse(this.form.categories)[event] === 'undefined') {
this.categoriesBasedTypes = [];
return;
}
if (this.form.parent_category_id) {
this.form.parent_category_id = null;
return;
}
2019-11-16 10:21:14 +03:00
2022-12-13 10:37:05 +03:00
this.selected_type = false;
2022-06-01 10:15:55 +03:00
this.categoriesBasedTypes = JSON.parse(this.form.categories)[event];
2019-11-16 10:21:14 +03:00
}
}
});