gpt4 book ai didi

javascript - 模态上的工具提示

转载 作者:行者123 更新时间:2023-11-30 13:46:44 25 4
gpt4 key购买 nike

谁能帮我解决我的问题,我有一个模式需要“打开对话框”按钮上的工具提示,

这是来自 vuetify 的示例: https://codepen.io/czechsebastian/pen/mdyyWze?&editable=true&editors=101

我想在使用 vuetify 工具提示悬停按钮时显示文本。

非常感谢

<div id="app">
<v-app id="inspire">
<v-row justify="center">
<v-dialog v-model="dialog" persistent max-width="290">
<template v-slot:activator="{ on }">
<v-btn color="primary" dark v-on="on">Open Dialog</v-btn>
</template>
<v-card>
<v-card-title class="headline">Use Google's location service?</v-card-title>
<v-card-text>Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green darken-1" text @click="dialog = false">Disagree</v-btn>
<v-btn color="green darken-1" text @click="dialog = false">Agree</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
</v-app>
</div>

最佳答案

您可以将按钮移到模态组件之外并更改激活器。

<div id="app">
<v-app id="inspire">
<v-row justify="center">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn color="primary" dark v-on="on" @click="dialog = !dialog">Open Dialog</v-btn>
</template>
<span>Tooltip</span>
</v-tooltip>
<v-dialog v-model="dialog" persistent max-width="290">
<v-card>
<v-card-title class="headline">Use Google's location service?</v-card-title>
<v-card-text>Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green darken-1" text @click="dialog = false">Disagree</v-btn>
<v-btn color="green darken-1" text @click="dialog = false">Agree</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
</v-app>
</div>

关于javascript - 模态上的工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59165370/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com