0.0.1 • Published 4 years ago

@atffe/atfui v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Install

Run the command below in your terminal to install atfUI first

cnpm install @atf/atfui --save

Usage

全局使用

Import in your entry script file and register it

import atfUi from '@atf/atfui'
import "@atf/atfui/lib/styles/atfui.css"
Vue.use(atfUi)

Example

 <atf-question
    v-for="(item, index) in list"
    :key="item.ques_id"
    :prefix="(index + 1) + '、'"
    :ques-index="index + 1"
    :data="item"
    :clickable="true"
    :dragable="false"
    always-show
    always-show-knowledge
    show-collect
    show-error
    show-add-basket
    :quesIndex="index + 1"
    :collect-state="1"
    :basket-state="1"
    @collect="showCollectModal"
    @error="showErrorModal"
    @add-basket="handleAddBasket"
    @del-basket="handleDelBasket">
</atf-question>

按需加载

npm install babel-plugin-component

1、babelrc 中 配置 
  plugins: [
      ["component", {
          "libraryName": "@atf/atfui",
          "libDir": "lib",
          "styleLibrary": {
              "name": "styles",
              "base": false,
              "path": "[module].css"
          }
      }]
  ]

2、 main 
    import {Question} from '@atf/atfui';
    or
    import Question from '@atf/atfui/lib/question';

    Vue.component('atfQuestion', Question)