Vue

by allanbanis

HTML

<div id="app">
  <b-card border-variant="primary" header="Results:" header-bg-variant="primary" header-text-variant="white" align="center">
    <div v-if="loading">
        <img width="50px" height="50px" src="/assets/img/loading.gif" />
    </div>
    <div v-else-if="tools.length">
        <div id="app" class="container">
            <div class="grid">
                <article v-for="tool in tools">
                    <div class="title">
                        <h3>{{capitalizeFirstLetter(tool.name)}}</h3>
                    </div>
                    <div class="description">
                        {{tool.description}}
                    </div>
                </article>
            </div>
        </div>
    </div>
</b-card>
</div>

CSS

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#app {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  transition: all 0.2s;
}

li {
  margin: 8px 0;
}

h2 {
  font-weight: bold;
  margin-bottom: 15px;
}

del {
  color: rgba(0, 0, 0, 0.3);
}

Vue

new Vue({
  el: "#app",
  data: {
   laoding:false,
   tools:[{name:"abc",description:"abc"}]
  },
  methods: {
  	mounted(){
    	this.$data.loading=this.$data.tools.length>0
    }
  }
})