父子传参
1、 <Images ref="Images" @DelaloneImg="querylistjx(MyTableEvent[0], MyTableEvent[1])"></Images>
子组件:this.$emit('DelaloneImg')
2、this.$refs.Images.tuzhanshilist(this.sketch)
this.$refs.组件名.组件定义一个方法接收(传的值)
页面之间直接使用值
A页面
<view class="button-my" style="margin-bottom: 10px;">
<u-button @click="check()" type="default" color="red">已是最新版本</u-button>
</view><script>
import edition from '../category/edition.vue';export default {
mixins: [edition],data (){
}
}
<script>
B页面
<script>
export default {
data() {
return {
version: '',
update: '',
}
},
onLoad() {
appVersion().then(res => {
this.update = res.data.update})
},methods: {
check() {
uni.showToast({
title: 'APP已经最新版本',
icon: 'none'
});
},}
}
父子组件传参 / 页面之间直接引用
于 2022-07-13 14:12:22 首次发布