提交 e0039c51 编写于 作者: fxy060608's avatar fxy060608

refactor api protocol

上级 c0ab213c
......@@ -3,7 +3,7 @@ const alias = require('rollup-plugin-alias')
const replace = require('rollup-plugin-replace')
const resolve = require('rollup-plugin-node-resolve')
const commonjs = require('rollup-plugin-commonjs')
const requireContext = require('./rollup-plugin-require-context')
const requireContext = require('../lib/rollup-plugin-require-context')
let input = 'src/platforms/app-plus/service/framework/create-instance-context.js'
......
export const $on = [{
name: 'event',
type: [String, Array],
required: true
}, {
name: 'callback',
type: Function,
required: true
}]
export const $once = $on
export const $off = [{
name: 'event',
type: [String, Array]
}, {
name: 'callback',
type: Function
}]
export const $emit = [{
name: 'event',
type: String,
required: true
}]
export const addInterceptor = [{
name: 'method',
type: [String, Object],
required: true
}]
export const removeInterceptor = addInterceptor
export const upx2px = [{
name: 'upx',
type: Number,
required: true
}]
export const chooseLocation = {
keyword: {
type: String
}
}
const type = {
WGS84: 'WGS84',
GCJ02: 'GCJ02'
}
export const getLocation = {
type: {
type: String,
validator (value, params) {
value = (value || '').toUpperCase()
params.type = Object.values(type).indexOf(value) < 0 ? type.WGS84 : value
},
default: type.WGS84
},
altitude: {
altitude: Boolean,
default: false
}
}
const type = {
WGS84: 'WGS84',
GCJ02: 'GCJ02'
}
export const getLocation = {
type: {
type: String,
validator (value, params) {
value = (value || '').toUpperCase()
params.type = Object.values(type).indexOf(value) < 0 ? type.WGS84 : value
},
default: type.WGS84
},
altitude: {
altitude: Boolean,
default: false
}
}
export const openLocation = {
latitude: {
type: Number,
......
import getRealRoute from '../get-real-route'
import getRealRoute from '../../get-real-route'
function encodeQueryString (url) {
if (typeof url !== 'string') {
......
export const getStorage = {
'key': {
type: String,
required: true
}
}
export const getStorageSync = [{
name: 'key',
type: String,
required: true
}]
export const setStorage = {
'key': {
type: String,
......@@ -15,4 +28,7 @@ export const setStorageSync = [{
}, {
name: 'data',
required: true
}]
}]
export const removeStorage = getStorage
export const removeStorageSync = getStorageSync
export * from './base/event-bus'
export * from './context/audio'
export * from './context/background-audio'
......@@ -41,7 +42,6 @@ export * from './plugin/oauth'
export * from './plugin/payment'
export * from './plugin/push'
export * from './plugin/share'
export * from './plugin/event-bus'
export * from './ui/keyboard'
export * from './ui/navigation-bar'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册