v-evoke-app

evoke app

Usage no npm install needed!

<script type="module">
  import vEvokeApp from 'https://cdn.skypack.dev/v-evoke-app';
</script>

README

描述


使用

import Evoke from 'v-evoke-app';

example

const evoke = new Evoke({
    scheme: {
        protocol: 'dfshoppingmall',
        host: 'product-details'
    },
    fallback: 'https://wx.dafysz.cn/down-giveU-wallet/'
})
evoke.open({
    path: '',
    param: {
        skuCode: 'K00011815'
    }
})
// 输出:dfshoppingmall://product-details/?skuCode=K00011815

Api

Evoke:

options: Object
    - scheme: Object scheme链接配置
        protocol: string
        host: host
    - fallback:string 引导页面链接

open

config: Object
    path: string 路径,普遍填空
    param: object url.search的参数

支持 scheme、 intent、universal,三种调用方式

配置好后,自动判断机型和浏览器,切换调用方式

具体参数

Options {
    timeout?: number;
    scheme: {
        host: string;
        port: number;
        protocol: string;
    };
    outChain?: {
        protocol: string;
        path: string;
        key: string;
    };
    intent?: {
        package: string;
        action: string;
        category: string;
        component: string;
        scheme: string;
        [key: string]: any
    };
    fallback: string;
    universal?: {
        host: string;
    };
    yingyongbao?: string;
    callback?: Function;
}

Config {
    path: string;
    param: {
        [key: string]: any;
    };
}