提交 75beb107 编写于 作者: D dolymood

remove $api object, for issue #31

上级 90b2a8f9
......@@ -5,9 +5,7 @@ export default function createAPI (Vue, Component, events, single) {
const api = createAPIComponent.apply(this, arguments)
const name = Component.name
const pureName = name.replace(/^cube-/i, '')
const apiName = `$${camelize(pureName)}`
const createName = `$${camelize(`create-${pureName}`)}`
Vue.prototype[apiName] = api
Vue.prototype[createName] = api.create
return api
}
......@@ -105,7 +105,8 @@ describe('Dialog', () => {
template: '<div>xx</div>',
methods: {
showAPI() {
ins = this.$dialog.confirm({
ins = this.$createDialog({
type: 'confirm',
showClose: true,
title: 'dialog api title',
content: 'dialog api content',
......
......@@ -89,7 +89,8 @@ describe('Toast', () => {
txt: 'error txt',
time: 200
})
ins = this.$toast.warn({
ins = this.$createToast({
type: 'warn',
txt: 'toast api content',
time: 100
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册