我刚试的,是可以的。
<template>
<button @click="jump">跳转</button>
<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<image class="userImg" :src="imagUrl"></image>
</button>
</template>
<script>
export default {
data() {
return {
imagUrl: ''
}
},
onLoad() {},
methods: {
onChooseAvatar(res) {
const {
detail
} = res
// 这是个临时路径
this.imagUrl = detail.avatarUrl
// 上传图片返回一个服务器路径
console.log('111111111111111111',detail);
},
jump() {
uni.navigateTo({
"url": "/uni_modules/uni-id-pages/pages/login/login-withoutpwd"
})
}
}
}
</script>