• vue 跑马灯效果


    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <title></title>
        </head>
        <body>
            <div id="app">
                <div>{{msg}}</div>
                <button @click="lang">浪起来</button>
                <button @click="stop">别浪</button>

            </div>
        </body>
        <script src="vue.js"></script>
        <script>
            var vm=new Vue({
                el:'#app',
                data:{
                    msg:'猥琐发育,别浪~~~~',
                    intervalId:null
                },
                methods:{
                    lang() {
                        if(this.intervalId!=null) return;
                        this.intervalId=setInterval( () =>{
                            var start = this.msg.substring(0,1);
                            var end= this.msg.substring(1);
                            this.msg=end+start;
                        },400)
                        
                    },stop(){
                        clearInterval(this.intervalId)
                        this.intervalId=null;
                    }
                }})
        </script>

    </html>
  • 相关阅读:
    django 项目 crm 关于展示表的细节
    djagngo crm 项目 展示页面 和分页
    django项目 crm登录 注册
    django项目 crm表结构一些常用的字段
    django认证 auth
    django form组件
    json和ajax技术
    VS 2013编译64位版本QT 4.8.6及使用cmake为依赖QT生成VS项目时Could NOT find Qt4
    使用国内pypi源来安装python包
    [转]ubuntu 下无法启动chrome
  • 原文地址:https://www.cnblogs.com/tiandlsd001/p/15242028.html
Copyright © 2020-2023  润新知