@sweetui/sweet-mobile-lib
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,4 +5,2 @@ import Input from './components/input/input.vue' | ||
import FormItem from './components/form/form-item.vue' | ||
// 版本号 | ||
const version = require('./package.json').version | ||
// 普通组件 | ||
@@ -24,3 +22,2 @@ const components = [ | ||
export default { | ||
version, | ||
install(Vue) { | ||
@@ -27,0 +24,0 @@ // Register all Components. |
{ | ||
"name": "@sweetui/sweet-mobile-lib", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Geely SweetUI Group", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Sweet Mobile Component 移动端组件库 | ||
本文将介绍 @sweetui/sweet-mobile-lib 的安装方式和基本的用法。 | ||
### npm安装 | ||
```npm | ||
npm i @sweetui/sweet-mobile-lib -S | ||
``` | ||
**完整引入** | ||
在 main.js 中写入以下内容: | ||
```js | ||
import Vue from 'vue' | ||
import sweetMobileLib from '@sweetui/sweet-mobile-lib' | ||
import '@sweetui/sweet-mobile-lib/css/index.less' | ||
import App from './App.vue' | ||
Vue.use(sweetMobileLib) | ||
new Vue({ | ||
el: '#app', | ||
render: h => h(App) | ||
}) | ||
``` | ||
**按需引入** | ||
接下来,如果你只希望引入部分组件,比如 Input 和 Group,那么需要在 main.js 中写入以下内容: | ||
```js | ||
import Vue from 'vue' | ||
import { Input, Group } from '@sweetui/sweet-mobile-lib' | ||
import App from './App.vue' | ||
Vue.component(Input.name, Button) | ||
Vue.component(Group.name, Select) | ||
new Vue({ | ||
el: '#app', | ||
render: h => h(App) | ||
}); | ||
``` | ||
24310
45
145