<template>
<div id="app" class="phone-viewport">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<router-view></router-view>
<bottomBar v-bind:visibles='show' ></bottomBar>
</div>
</template>
<script>
export default {
name: '',
show: '',
data() {
return {
visibles: [
{name: 'Football', show: true},
{name: 'Basketball', show: true},
{name: 'Hockey', show: true},
{name: 'VolleyBall', show: false},
{name: 'Baseball', show: false},
]
}
}
}
</script>
我正在尋找隱藏bottomBar只在VolleyBall和Beisbol。 但我一直有這樣的錯誤「屬性或方法‘秀’是不是在實例中定義,但在引用的渲染。確保在數據選項聲明反應數據屬性。 」Vue js 2隱藏共享組件
<script>
export default {
name: 'app',
data() {
return {}
},
computed: {
hideBottom: function() {
if (this.$router.path === '/baseball' || this.$router.path === '/volleyball') return false
else { return true }
}
}
}
沒有它幫助你或給予好評是從別人? –