赞
踩
在 Vue 中使用鼠标悬停显示说明文字可以使用 v-bind 指令绑定一个 title 属性到图片元素上。
例如:
- <template>
- <img v-bind:title="description" src="image.jpg" alt="image">
- </template>
-
- <script>
- export default {
- data() {
- return {
- description: 'This is a description of the image'
- }
- }
- }
- </script>
这样,当用户将鼠标移动到图片上时
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。