File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1
1
export function warn ( msg ) {
2
- console . error ( `[create-api warn]: ${ msg } ` )
2
+ console . error ( `[vue- create-api warn]: ${ msg } ` )
3
3
}
4
4
5
5
export function assert ( condition , msg ) {
6
6
if ( ! condition ) {
7
- throw new Error ( `[create-api error]: ${ msg } ` )
7
+ throw new Error ( `[vue- create-api error]: ${ msg } ` )
8
8
}
9
9
}
10
10
11
11
export function tip ( msg ) {
12
- console . warn ( `[create-api tip]: ${ msg } ` )
12
+ console . warn ( `[vue- create-api tip]: ${ msg } ` )
13
13
}
Original file line number Diff line number Diff line change 1
1
import { camelize , escapeReg , isBoolean } from './util'
2
- import { assert } from './debug'
2
+ import { assert , warn } from './debug'
3
3
import apiCreator from './creator'
4
4
5
+ let installed = false
6
+
5
7
function install ( Vue , options = { } ) {
8
+ if ( installed ) {
9
+ warn ( '[vue-create-api] already installed. Vue.use(CreateAPI) should be called only once.' )
10
+ return
11
+ }
12
+ installed = true
6
13
const { componentPrefix = '' , apiPrefix = '$create-' } = options
7
14
8
15
Vue . createAPI = function ( Component , events , single ) {
You can’t perform that action at this time.
0 commit comments