diff --git a/src/components/ObjectInspector.vue b/src/components/ObjectInspector.vue index 10058f31..9c4f6147 100644 --- a/src/components/ObjectInspector.vue +++ b/src/components/ObjectInspector.vue @@ -145,7 +145,7 @@ import 'tippy.js/animations/scale.css' import 'tippy.js/animations/shift-away.css' import 'tippy.js/animations/shift-toward.css' -export default defineComponent({ +export default { components: { ObjectImage, BiomeImage, @@ -170,6 +170,10 @@ export default defineComponent({ } }; + onMounted(() => { + loadObject(); + }); + watch( () => route.params.id, () => { @@ -177,10 +181,6 @@ export default defineComponent({ } ); - onMounted(() => { - loadObject(); - }); - const biomes = computed(() => { return object.value?.data?.biomes?.map(biomeData => Biome.find(biomeData.id.toString())) || []; }); @@ -333,7 +333,7 @@ export default defineComponent({ metaInfo() { return { title: this.object?.name }; }, -}); +}; - - - /** - * Return the placeholder string if it's set - * & there is no value selected. - * @return {String} Placeholder text - */ - searchPlaceholder() { - if (this.isValueEmpty && this.placeholder) { - return this.placeholder; - } - }, + diff --git a/src/mixins/ajax.js b/src/mixins/ajax.js deleted file mode 100644 index b8970535..00000000 --- a/src/mixins/ajax.js +++ /dev/null @@ -1,72 +0,0 @@ -module.exports = { - props: { - /** - * Toggles the adding of a 'loading' class to the main - * .v-select wrapper. Useful to control UI state when - * results are being processed through AJAX. - */ - loading: { - type: Boolean, - default: false - }, - - /** - * Accept a callback function that will be - * run when the search text changes. - * - * loading() accepts a boolean value, and can - * be used to toggle a loading class from - * the onSearch callback. - * - * @param {search} String Current search text - * @param {loading} Function(bool) Toggle loading class - */ - onSearch: { - type: Function, - default: function(search, loading){} - } - }, - - data() { - return { - mutableLoading: false - } - }, - - watch: { - /** - * If a callback & search text has been provided, - * invoke the onSearch callback. - */ - search() { - if (this.search.length > 0) { - this.onSearch(this.search, this.toggleLoading) - this.$emit('search', this.search, this.toggleLoading) - } - }, - /** - * Sync the loading prop with the internal - * mutable loading value. - * @param val - */ - loading(val) { - this.mutableLoading = val - } - }, - - methods: { - /** - * Toggle this.loading. Optionally pass a boolean - * value. If no value is provided, this.loading - * will be set to the opposite of it's current value. - * @param toggle Boolean - * @returns {*} - */ - toggleLoading(toggle = null) { - if (toggle == null) { - return this.mutableLoading = !this.mutableLoading - } - return this.mutableLoading = toggle - } - } -} diff --git a/src/mixins/index.js b/src/mixins/index.js deleted file mode 100644 index 991ad77c..00000000 --- a/src/mixins/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import ajax from './ajax' -import pointer from './typeAheadPointer' -import pointerScroll from './pointerScroll' - -export default { ajax, pointer, pointerScroll } diff --git a/src/models/GameObject.js b/src/models/GameObject.js index 811b10f2..0b295d35 100644 --- a/src/models/GameObject.js +++ b/src/models/GameObject.js @@ -156,7 +156,8 @@ export default class GameObject { return "/not-found"; const path = [`${this.id}-${this.name.replace(/\W+/g, '-')}`]; if (subpath) path.push(subpath); - return '/' + path.map(encodeURIComponent).join("/"); + let ret = '/' + path.map(encodeURIComponent).join("/"); + return ret; } clothingPart() {