初始化(包含登录模块)

This commit is contained in:
2024-03-29 17:37:48 +08:00
commit 1bcb13ce7a
1306 changed files with 152772 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import Vue from 'vue'
export default new Vue()

View File

@@ -0,0 +1,36 @@
<template>
<view>
<page-head title="组件通讯示例"></page-head>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<reciver></reciver>
<sender></sender>
<sender-bus></sender-bus>
</view>
</view>
</view>
</template>
<script>
import reciver from './reciver.vue'
import sender from './sender.vue'
import senderBus from './sender-bus.vue'
export default {
components:{
reciver,
sender,
senderBus
},
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,36 @@
<template>
<view>
<view class="reciver">
{{msg===''?'等待发送':'收到消息:'}}{{msg}}
</view>
</view>
</template>
<script>
export default {
data() {
return {
msg: ''
}
},
created() {
uni.$on('cc', this.recive)
},
beforeDestroy() {
uni.$off('cc',this.recive)
},
methods: {
recive(e) {
this.msg = e.msg
}
}
}
</script>
<style>
.reciver {
padding: 40px 0px;
text-align: center;
line-height: 40px;
}
</style>

View File

@@ -0,0 +1,24 @@
<template>
<view class="sender-container">
<button type="primary" @click="send">自定义EventBus</button>
</view>
</template>
<script>
export default {
methods: {
send() {
let num = parseInt(Math.random() * 10000)
uni.$emit('cc', {
msg: 'From event bus -> ' + num
})
}
}
}
</script>
<style>
.sender-container{
padding: 20px;
}
</style>

View File

@@ -0,0 +1,24 @@
<template>
<view class="sender-container">
<button type="primary" @click="send">点击发送消息</button>
</view>
</template>
<script>
export default {
methods: {
send() {
let num = parseInt(Math.random() * 10000)
uni.$emit('cc', {
msg: 'From uni.$emit -> ' + num
})
}
}
}
</script>
<style>
.sender-container{
padding: 20px;
}
</style>