naive-ui/demo/documentation/components/loadingBar/zhCN/basic.md
2020-01-29 21:53:48 +08:00

466 B

基础用法

<n-button @click="handleStart">
  开始
</n-button>
<n-button @click="handleFinish">
  结束
</n-button>
<n-button @click="handleError">
  报个错
</n-button>
export default {
  methods: {
    handleStart() {
      this.$NLoadingBar.start();
    },
    handleFinish() {
      this.$NLoadingBar.finish();
    },
    handleError() {
      this.$NLoadingBar.error();
    }
  }
};
.n-button {
  margin: 0 12px 8px 0;
}