Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :type="type" :openid="oid" v-text="oid"/>
|
<div :type="type" :openid="oid">
|
||||||
|
<div class="loading" v-text="`读取中...`"/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -19,15 +21,20 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
...mapActions(['injectJWeixin']),
|
...mapActions(['injectJWeixin']),
|
||||||
bindWWOpenData() {
|
bindWWOpenData() {
|
||||||
if (window?.WWOpenData) WWOpenData.bind(this.$el)
|
if (window?.WWOpenData) {
|
||||||
else this.injectJWeixin().then(() => {
|
WWOpenData.bind(this.$el)
|
||||||
this.$nextTick(() => {
|
} else {
|
||||||
WWOpenData.bind(this.$el)
|
this.injectJWeixin().then(() => {
|
||||||
WWOpenData.on('update', () => {
|
this.$nextTick(() => {
|
||||||
WWOpenData.bind(this.$el)
|
WWOpenData.bind(this.$el)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
openid(v) {
|
||||||
|
v && this.bindWWOpenData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -35,3 +42,19 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.loading {
|
||||||
|
color: transparent;
|
||||||
|
height: 100%;
|
||||||
|
animation: loading 1s infinite alternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes loading {
|
||||||
|
from {
|
||||||
|
background: rgba(#eee,.6);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
background: rgba(#eee,.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user