naive-ui/demo/documentation/components/loading-bar/enUS/basic.demo.md
2020-12-12 15:33:41 +08:00

448 B

Basic

<n-space>
  <n-button @click="handleStart"> start </n-button>
  <n-button @click="handleFinish"> finish </n-button>
  <n-button @click="handleError"> error </n-button>
</n-space>
export default {
  inject: ['loadingBar'],
  methods: {
    handleStart () {
      this.loadingBar.start()
    },
    handleFinish () {
      this.loadingBar.finish()
    },
    handleError () {
      this.loadingBar.error()
    }
  }
}