提交 3e73c08d 编写于 作者: D dolymood

update modules usage: use babel-transform-modules style.ignore

上级 d24ddfd4
......@@ -48,25 +48,25 @@ First we create Hello.vue component:
</script>
```
Then we make Hello.vue to an API Style component by calling the `createAPI` method.
Then we make Hello.vue to an API style component by calling the `createAPI` method.
```js
import Vue from 'vue'
import Hello from './Hello.vue'
import createAPI from 'cube-ui/lib/create-api'
// import Style to load the base style
import {
/* eslint-disable no-unused-vars */
Style,
Dialog
Dialog,
createAPI
} from 'cube-ui'
Vue.use(Dialog)
// create this.$createHello API
createAPI(Vue, Hello, ['click'], true)
// init Vue
new Vue({
el: '#app',
......@@ -100,7 +100,7 @@ Then we make Hello.vue to an API Style component by calling the `createAPI` meth
icon: 'cubeic-alert'
})
$dialog.show()
$dialog.$on('confirm', () => {
// remove instance
instance.remove()
......
......@@ -19,7 +19,9 @@ Before use, the plugin needs some configuration. Modify .babelrc:
"cube-ui": {
"transform": "cube-ui/lib/${member}",
"kebabCase": true,
"style": true
"style": {
"ignore": ["create-api", "better-scroll"]
}
}
}]
]
......@@ -108,12 +110,10 @@ import {
} from 'cube-ui'
```
**Notice:** `better-scroll` and `create-api` module can only be used as the follows:
You can also import [create-api](#/en-US/docs/create-api) and [better-scroll](#/en-US/docs/better-scroll) module:
```js
import BScroll from 'cube-ui/lib/better-scroll'
import createAPI from 'cube-ui/lib/create-api'
import { createAPI, BetterScroll } from 'cube-ui'
```
#### Examples
......
......@@ -53,20 +53,20 @@
```js
import Vue from 'vue'
import Hello from './Hello.vue'
import createAPI from 'cube-ui/lib/create-api'
// 引入 Style 加载基础样式
import {
/* eslint-disable no-unused-vars */
Style,
Dialog
Dialog,
createAPI
} from 'cube-ui'
Vue.use(Dialog)
// 创建 this.$createHello API
createAPI(Vue, Hello, ['click'], true)
// 初始化 Vue
new Vue({
el: '#app',
......@@ -103,7 +103,7 @@
icon: 'cubeic-alert'
})
$dialog.show()
$dialog.$on('confirm', () => {
// 销毁实例
instance.remove()
......
......@@ -25,7 +25,9 @@ $ npm install babel-plugin-transform-modules --save-dev
"cube-ui": {
"transform": "cube-ui/lib/${member}",
"kebabCase": true,
"style": true
"style": {
"ignore": ["create-api", "better-scroll"]
}
}
}]
]
......@@ -109,11 +111,10 @@ import {
} from 'cube-ui'
```
**注意:** `better-scroll``create-api` 两个模块只能通过如下方式使用
也可以引入[create-api](#/zh-CN/docs/create-api)[better-scroll](#/zh-CN/docs/better-scroll)模块
```js
import BScroll from 'cube-ui/lib/better-scroll'
import createAPI from 'cube-ui/lib/create-api'
import { createAPI, BetterScroll } from 'cube-ui'
```
#### 示例
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册