fix(vue3): 修复 Vue3 兼容问题
1) user/list.vue: \ 改为 Proxy 直接赋值(官方 2.5.1 仍存在该 bug,3.0.0 才修复)2) uni-menu-item/uni-sub-menu: destroyed→unmounted 3) show-info: 移除已废除的 .native 修饰符
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="position: relative;">
|
<view style="position: relative;">
|
||||||
<uni-icons @mouseenter.native="mouseenter" @mouseleave.native="showStableInfo = false"
|
<uni-icons @mouseenter="mouseenter" @mouseleave="showStableInfo = false"
|
||||||
style="padding:0 10px;color: #a8a8a8;cursor: pointer;" type="info" />
|
style="padding:0 10px;color: #a8a8a8;cursor: pointer;" type="info" />
|
||||||
<view v-if="showStableInfo" class="show-stable" :style="{top:`${top}px`,left:`${left}px`,width:`${width}px`}">
|
<view v-if="showStableInfo" class="show-stable" :style="{top:`${top}px`,left:`${left}px`,width:`${width}px`}">
|
||||||
<text>{{content}}</text>
|
<text>{{content}}</text>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
created() {
|
created() {
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
if (this.$menuParent) {
|
if (this.$menuParent) {
|
||||||
const menuIndex = this.$menuParent.itemChildrens.findIndex(item => item === this)
|
const menuIndex = this.$menuParent.itemChildrens.findIndex(item => item === this)
|
||||||
this.$menuParent.itemChildrens.splice(menuIndex, 1)
|
this.$menuParent.itemChildrens.splice(menuIndex, 1)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
created() {
|
created() {
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
// 销毁页面后,将当前页面实例从数据中删除
|
// 销毁页面后,将当前页面实例从数据中删除
|
||||||
if (this.$menuParent) {
|
if (this.$menuParent) {
|
||||||
const menuIndex = this.$menuParent.subChildrens.findIndex(item => item === this)
|
const menuIndex = this.$menuParent.subChildrens.findIndex(item => item === this)
|
||||||
|
|||||||
@@ -133,10 +133,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
collectionList: [
|
collectionList: [ db.collection('uni-id-users').field('ali_openid,apple_openid,avatar,avatar_file,comment,dcloud_appid,department_id,email,email_confirmed,gender,invite_time,inviter_uid,last_login_date,last_login_ip,mobile,mobile_confirmed,my_invite_code,nickname,role,score,status,username,wx_unionid,qq_unionid,tags').getTemp(),db.collection('uni-id-roles').field('role_id, role_name').getTemp() ],
|
||||||
db.collection('uni-id-users').field('_id,ali_openid,apple_openid,avatar,avatar_file,comment,dcloud_appid,department_id,email,email_confirmed,gender,invite_time,inviter_uid,last_login_date,last_login_ip,mobile,mobile_confirmed,my_invite_code,nickname,role,score,status,username,wx_unionid,qq_unionid,tags').getTemp(),
|
|
||||||
db.collection('uni-id-roles').field('_id,role_id, role_name').getTemp()
|
|
||||||
],
|
|
||||||
query: '',
|
query: '',
|
||||||
where: '',
|
where: '',
|
||||||
orderby: dbOrderBy,
|
orderby: dbOrderBy,
|
||||||
@@ -399,7 +396,8 @@
|
|||||||
loadTags() {
|
loadTags() {
|
||||||
db.collection('uni-id-tag').limit(500).get().then(res => {
|
db.collection('uni-id-tag').limit(500).get().then(res => {
|
||||||
res.result.data.map(item => {
|
res.result.data.map(item => {
|
||||||
this.$set(this.tags, item.tagid, item.name)
|
// Vue3 已移除 $set,Proxy 响应式可直接对新增属性赋值
|
||||||
|
this.tags[item.tagid] = item.name
|
||||||
})
|
})
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
|
|||||||
Reference in New Issue
Block a user