Skip to content

安装

注意,组件库 仅支持 Vue3。如果你在使用 Vue2,可以去看看别的库。

npm

使用npm安装

sh
npm i nrelaxed-ui

pnpm

使用npm安装

sh
pnpm i nrelaxed-ui

UDM

html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <script src="https://unpkg.com/vue"></script>
    <!-- 会使用最新版本,你最好指定一个版本 -->
    <script src="https://unpkg.com/nrelaxed-ui"></script>
  </head>
  <body>
    <div id="app">
      <n-button>{{ message }}</n-button>
    </div>
    <script>
      const App = {
        setup() {
          return {
            message: 'naive'
          }
        }
      }
      const app = Vue.createApp(App)
      app.use(naive)
      app.mount('#app')
    </script>
  </body>
</html>

按需引入

typescript
import { RButton, RIcon } from 'nrelaxed-ui';

全局引入

typescript
import {createApp} from 'vue'
import NRelaxed from 'nrelaxed-ui';
import 'nrelaxed-ui/lib/style.css';

import App from './App.vue';
const app = createApp(App);
app.use(NRelaxed);
app.mount('#app');