All files / src index.js

0% Statements 0/14
0% Branches 0/8
0% Functions 0/3
0% Lines 0/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70                                                                                                                                           
// import locale from './locale';
import drag from "./utils/drag";
 
import FadePop from './components/fade-pop';    
import Loading from './components/loading';
import SideNav from './components/side-nav';
import Table from './components/table';
import ColTable from './components/col-table';
import Tip from './components/tip';
import Tab from './components/tab';
import Tree from './components/tree';
import UploadBtn from './components/upload-btn';
import Markdown from './components/markdown';
import SelectSearch from './components/select-search';
import SearchBar from './components/search-bar';
import Provider from './components/provider';
 
const components=[
  Provider,
  FadePop,
  SideNav,
  Tree,
  Tip,
  Tab,
  Table,
  ColTable,
  UploadBtn,
  Markdown,
  SelectSearch,
  SearchBar,
];
 
const install=(Vue,
    // opts = {}
  )=>{
    // locale.use(opts.lang);
    // locale.i18n(opts.i18n);
    
    if (install.installed) return;
 
    Vue.use(Loading);
    Vue.directive("draggable", {
        inserted(el, binding) {
          if (binding.value !== false) {
            drag(el.parentNode.parentNode, el);
          }
        },
      });
 
    components.forEach(item=>{
        Vue.component(item.name,item);
    });
 
    install.installed= true;
};
 
 
if (typeof window !== 'undefined'&&window.Vue){
    install(window.Vue);
}
 
const KView = {
    // i18n: locale.i18n,
    // locale,
    install,
    ...components,
};
 
export default KView;