fix(client): Fix bug that cannot set custom texture

This commit is contained in:
syuilo 2020-05-09 15:55:00 +09:00
parent 0294061c00
commit f2465ca11f
2 changed files with 5 additions and 5 deletions

View file

@ -16,7 +16,7 @@
<div v-for="k in Object.keys(selectedFurnitureInfo.props)" :key="k"> <div v-for="k in Object.keys(selectedFurnitureInfo.props)" :key="k">
<p>{{ k }}</p> <p>{{ k }}</p>
<template v-if="selectedFurnitureInfo.props[k] === 'image'"> <template v-if="selectedFurnitureInfo.props[k] === 'image'">
<mk-button @click="chooseImage(k)">{{ $t('_rooms.chooseImage') }}</mk-button> <mk-button @click="chooseImage(k, $event)">{{ $t('_rooms.chooseImage') }}</mk-button>
</template> </template>
<template v-else-if="selectedFurnitureInfo.props[k] === 'color'"> <template v-else-if="selectedFurnitureInfo.props[k] === 'color'">
<input type="color" :value="selectedFurnitureProps ? selectedFurnitureProps[k] : null" @change="updateColor(k, $event)"/> <input type="color" :value="selectedFurnitureProps ? selectedFurnitureProps[k] : null" @change="updateColor(k, $event)"/>
@ -69,6 +69,7 @@ import { faSave, faTrashAlt } from '@fortawesome/free-regular-svg-icons';
import { query as urlQuery } from '../../../prelude/url'; import { query as urlQuery } from '../../../prelude/url';
import MkButton from '../../components/ui/button.vue'; import MkButton from '../../components/ui/button.vue';
import MkSelect from '../../components/ui/select.vue'; import MkSelect from '../../components/ui/select.vue';
import { selectFile } from '../../scripts/select-file';
let room: Room; let room: Room;
@ -224,10 +225,8 @@ export default Vue.extend({
}); });
}, },
chooseImage(key) { chooseImage(key, e) {
this.$chooseDriveFile({ selectFile(this, e.currentTarget || e.target, null, false).then(file => {
multiple: false
}).then(file => {
room.updateProp(key, `/proxy/?${urlQuery({ url: file.thumbnailUrl })}`); room.updateProp(key, `/proxy/?${urlQuery({ url: file.thumbnailUrl })}`);
this.$refs.preview.selected(room.getSelectedObject()); this.$refs.preview.selected(room.getSelectedObject());
this.changed = true; this.changed = true;

View file

@ -51,6 +51,7 @@ export function selectFile(component: any, src: any, label: string | null, multi
}); });
}; };
// TODO
const chooseFileFromUrl = () => { const chooseFileFromUrl = () => {
}; };