Skip to content

v-loading

Function Introduction

Add loading animation

Example

Usage

javascript
<script setup lang="ts">
import { ref } from 'vue'

const loading = ref(false)
</script>
<template>
  <div
    v-loading="loading"
    :style="{
      width: '180px',
      height: '180px',
      backgroundImage: 'url('https://avatars.githubusercontent.com/u/108746194?s=96&v=4')',
      backgroundSize: 'cover',
      borderRadius: '5px'
    }"></div>
  <button @click="loading.value = !loading.value">State switch</button>
</template>

Released under the MIT License.