Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<div id="app">
  <div class="test"  v-bind:style="bg()"></div>
  </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>
  </body>
</html>
 
.test {
  width: 200px;
  height: 200px;
  background: green;
  background-size: cover;
  background-repeat: no-repeat;
}
 
new Vue({
    el: "#app",
    data: { },
    methods: {
      bg: function () { 
        var url = "https://picsum.photos/200/200.webp";
        var bg = "background-image:-webkit-image-set(url('"+ url +"')2x,url('"+ url +"')2x);background-image:image-set(url('"+ url +"')2x,url('"+ url +"')2x);"; 
        return bg;
      }
     }
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers