我有一个由多个组件组成的app.vue.其中一个组件上有一个覆盖图,上面有一个按钮,可以禁用该覆盖图并在单击后使内容可见.然而,一旦我点击屏幕上的任何地方,覆盖就会被禁用,而不是按钮.
template>
<v-card>
<v-row>
<v-overlay opacity="0.88" :absolute="true" :model-value="overlay" contained>
<v-btn color="warning" @click="disenable(false)">No Automation</v-btn>
</v-overlay>
</v-row>
<v-toolbar flat dense color="indigo" style="height: 80px;">
<v-toolbar-title style="padding-top: 40px;">
Active Strategies
</v-toolbar-title>
</v-toolbar>
<v-divider class="mx-4"></v-divider>
<v-table fixed-header height="auto">
<thead>
<tr>
<th class="text-left">Assetpair</th>
<th class="text-left">Strategy</th>
<th class="text-left">Actions</th>
</tr>
</thead>
<tbody>
<tr v-for="row in strategies" v-bind:key="row.ticker">
<td>{{ row.assetpair }}</td>
<td>{{ row.strategy }}</td>
<td>
<div class="text-left">
<v-chip class="ma-2" color="red" dark @click="stopStrategy(127)">
<v-icon left>mdi-server-plus</v-icon>Stop Strategy
</v-chip>
</div>
</td>
</tr>
</tbody>
</v-table>
</v-card>
</template>
<script>
如果我从数据部分移除覆盖props ,则不会显示覆盖:
import axios from 'axios'
// import StrategyProvider from "../lib/strategy.js";
import { ref } from 'vue'
const strategies = ref([{}, {}])
const overlay = ref(true)
const setOverlay = v => (overlay.value = v)
export default {
// props: ["strategies"],
data: function() {
return {
overlay: true,
strategies: []
};
},