Coder Social home page Coder Social logo

casperwnb / crawlab-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crawlab-team/crawlab-ui

0.0 0.0 0.0 31.05 MB

๐ŸŽ‰ A Vue.js 3.0 UI Library made by Crawlab team

Home Page: https://crawlab.cn

License: BSD 3-Clause "New" or "Revised" License

Shell 0.04% JavaScript 6.56% HTML 0.98% Vue 92.43%

crawlab-ui's Introduction

Crawlab-UI

This is the UI components and modules to support the frontend development for Crawlab.

How to Install

Use npm or yarn to install crawlab-ui.

# npm
npm install crawlab-ui -S

# or use yarn
yarn add crawlab-ui -S

How to Use

It is similar to Element-Plus, you can import components from Crawlab-UI. Crawlab-UI is built based on Element-Plus so that you can comfortably use it with Element-Plus.

Use Globally Installed Components

Below is an example of entry file (main.ts) using Crawlab-UI globally.

import {createApp} from 'vue';
import CrawlabUI from 'crawlab-ui';

const app = createApp(App);
app
  .use(CrawlabUI)  // install globally
  .mount('#app');

Below is an example of using globally installed Crawlab-UI in a Vue 3 component.

<template>
  <cl-form :model="form">
    <cl-form-item :span="2" label="Key" prop="key" required>
      <el-input v-model="form.key"/>
    </cl-form-item>
    <cl-form-item :span="2" label="Value" prop="value" required>
        <el-input v-model="form.value"/>
    </cl-form-item>
  </cl-form>
</template>

<script lang="ts">
import {defineComponent, ref} from 'vue';

export default defineComponent({
  setup() {
    const form = ref({
      key: 'test-key',
      value: 'test-value',
    });
    return {
      form,
    };
  },
});
</script>

Use Standalone Components

Below is an example of using standalone components in a Vue 3 component.

<template>
  <cl-form :model="form">
    <cl-form-item :span="2" label="Key" prop="key" required>
      <el-input v-model="form.key"/>
    </cl-form-item>
    <cl-form-item :span="2" label="Value" prop="value" required>
      <el-input v-model="form.value"/>
    </cl-form-item>
  </cl-form>
</template>

<script lang="ts">
import {defineComponent, ref} from 'vue';
import {ClForm, ClFormItem} from 'crawlab-ui';

export default defineComponent({
  components: {
    ClForm,
    ClFormItem,
  },
  setup() {
    const form = ref({
      key: 'test-key',
      value: 'test-value',
    });
    return {
      form,
    };
  },
});
</script>

Use Web Application

Crawlab-UI has a built-in web application for Crawlab frontend. You can simply use it to start Crawlab frontend Vue 3 SPA.

// index.ts or index.js or other entry file
import {createApp} from 'crawlab-ui';
createApp();

And that's it! After you build or start serving it, you can view the Crawlab frontend web application in the browser.

Development

crawlab-ui's People

Contributors

bastarder avatar beadre avatar bradleyzhou avatar brooooooklyn avatar caaalabash avatar chris-kin avatar chuo0817 avatar dependabot-preview[bot] avatar fengxingyuan avatar g3r4n avatar hanx316 avatar herringtondarkholme avatar iamkun avatar justwiner avatar jw-foss avatar kooriookami avatar liiked avatar liupl avatar rottenpen avatar ryan2128 avatar shlroland avatar simonaliachen avatar ther-su avatar tikazyq avatar vgbire avatar xiaofeng-bm avatar xyorz avatar yunyoujun avatar zazzaz avatar zouhangwithsweet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.