fix: 更改图片的同时更改头像; #42

Merged
yangws merged 1 commits from yangws into main 2024-07-18 16:01:19 +08:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit bdc67a6a0e - Show all commits

View File

@ -53,7 +53,7 @@ const { ipcRenderer } = window.electron || {}
const isMaxSize = ref(false) const isMaxSize = ref(false)
const router = useRouter() const router = useRouter()
const currentRoute = ref('') const currentRoute = ref('')
const userImg = new URL(userStore.user.avatar, import.meta.url) const userImg = ref(new URL(userStore.user.avatar, import.meta.url))
const menus = ref([ const menus = ref([
{ {
@ -128,6 +128,9 @@ const emits = defineEmits(['setLayout'])
function setLayout() { function setLayout() {
emits('setLayout'); emits('setLayout');
} }
watch(()=> userStore.avatar,() => {
userImg.value = userStore.avatar;
},{deep:true})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -174,7 +174,6 @@ function realTime(data) {
/** 关闭窗口 */ /** 关闭窗口 */
function closeDialog() { function closeDialog() {
options.img = userStore.avatar options.img = userStore.avatar
console.log(userStore.avatar,'userStore.avatar')
options.visible = false options.visible = false
} }
watch(transform, () => { watch(transform, () => {