vue 实现鼠标悬浮 显示操作按钮

vue 实现鼠标悬浮 显示操作按钮

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div class="a" 
        @mouseenter="enter()"     
        @mouseleave="leave()"
        >   <input type="text" value="这边是列表">
            <button class="b" v-show="flag" :title="message">查看详情</button>
        </div>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.0/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data() {
                return {
                    flag: false,
                    message: '页面加载于 ' + new Date().toLocaleString()
                };
            },
            methods: {
                enter() {
                    this.flag = true
                },
                leave() {
                    this.flag = false
                }
            }
        });
    </script>
</body>

</html>
上一篇:cors时session取数据失败


下一篇:gateway 跨域