Mint-UI—Toast

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://unpkg.com/mint-ui/lib/style.css">
  <script src="https://unpkg.com/vue/dist/vue.js"></script>
  <!-- import JavaScript -->
  <script src="https://unpkg.com/mint-ui/lib/index.js"></script>
  <style type="text/css">
      .mytoast{
      color:#e4393c;         /*红色文字*/
      background-color: #fff;/*白色背景*/
      font-size:12px;          /*字体*/
      border:1px solid #aaa; /*边框*/
    }
  </style>
</head>
<body>
  <div id="app">
    <mt-button @click.native="handleClick">Button</mt-button>
  </div>
</body>
  <!-- import Vue before Mint UI -->
  
  <script>
    new Vue({
      el: '#app',
      //点击出现弹框
      methods: {
        handleClick: function() {
          this.$toast({
          message: 'Upload Complete',
          position: 'bottom',
          duration: 5000,
           className:"mytoast"  

          });
        }
      },
      //直接出现弹框
      //   created(){
      //  let instance= this.$toast({
      //   message: 'Upload Complete',
      //   position: 'bottom',
      //   duration: -1
      // });
        
      //   setTimeout(() => {
      //     instance.close();
      //   }, 2000);
      // }

      //   }
    })
  </script>
</html>

vue 移动端UI组件/项目 (mint-ui;mui)

Mint-UI—LazyLoad

知识点
懒加载图片组件

  • vue 移动端UI组件/项目 (mint-ui;mui)
img[lazy=loading]{ width:40px; height:100px; margin:auto; } #### 实际的应用: ``` Document
vue 移动端UI组件/项目 (mint-ui;mui)
<script>
  new Vue({
    el:"#app",
    data:function(){
      return {
        list:
          ["img/01.jpg",
          "img/02.jpg",
          "img/03.jpg",
          "img/04.jpg"
          ]
      }
    }
  });
</script>
```

相关文章: