0.1.0 • Published 4 years ago

tuhub-mars-shop v0.1.0

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

#途虎B端组件库

Version

v0.0.6 fix折叠面板 v0.0.7 fix折叠面板 v0.0.9 utils copy ###组件库开发 // 使用InitInstall为组件添加install 全局注册方法, 参数为组件名 @InitInstall('ScrollView') @Component({ components: { ScrollView } }) class App extends Vue { }

###组件库使用方法

本地开发: npm run start
网站部署: npm run build-site
组件库编译: npm run build

###组件库按需加载

npm install babel-plugin-import
babel plugins 添加
[
      'import', {
      libraryName: '@shop/mars',
      libraryDirectory: 'dist/esm',
      camel2DashComponentName: false,
      style: (name) => (`${name}/index.css`)
    }, '@shop/mars'
]

###组件库用法

全局引入

import Mars from '@shop/mars'
Vue.use(Mars);

按需引入

import {MrHeader, MrButton} from '@shop/mars'
Vue.use(MrHeader);
Vue.use(MrButton);
...

组件静态资源存放

图片资源大于20k建议使用网络图片,如果一定要存放在项目中,请存放在src/assets/images
使用时,然后以下方式使用。该图片会生成base64,请谨慎使用

import src from '@/assets/images/empty/empty-fail.png';
created() {
    this.src = src;
}
0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago