各位,遇到个问题,父组件中有个元素,想再子组件中控制显示与隐藏
父组件:
index.vue
<template>
<div class="pt-all">
<div class="login-header-logo p-f" v-show="showLogo"></div>
<transition name="fade">
<keep-alive>
<router-view></router-view>
</keep-alive>
</transition>
</div>
</template>
<script>
export default {
// to do
data(){
return{
showLogo:false
}
}
}
子组件:
<template>
// ...
</template>
<script>
import $ from 'jquery'
import {api} from '../../commonjs/api'
export default {
components:{
},
props:{
showLogo:true
},
mounted(){
this.showLogo = true;
},
data(){
return{
wrongTip:false
}
}
}
类似这种,能否在login.vue中控制index.vue的值?新手,各位大神勿喷!?
白板的微信
相关分类