@heimdallr-sdk/vue
v0.0.23
Published
A Plugin For Browser SDK
Downloads
165
Maintainers
Readme
@heimdallr-sdk/vue
捕获 vue 框架抛出的错误
Options
|配置名称|类型|描述|默认值|可选值| |-|-|-|-|-| |vue|Object|vue 实例|-|-|
Usage
cdn
<script src="[vue-dist]/vue.iife.js"></script>
<script>
window.__HEIMDALLR_OPTIONS__ = {
dsn: {
host: 'localhost:8888',
init: '/project/init',
upload: '/log/upload'
},
app: {
name: 'playgroundAPP',
leader: 'test',
desc: 'test proj'
},
plugins: [
HEIMDALLR_VUE({
vue: VueInstance
}),
],
};
</script>
<script async src="/browser-dist/browser.iife.js"></script>
npm
Vue2.x
import Vue from "vue";
import heimdallr from "@heimdallr-sdk/browser";
import vuePlugin from "@heimdallr-sdk/vue";
heimdallr({
dsn: {
host: "localhost:8888",
init: "/project/init",
upload: "/log/upload",
},
app: {
name: "playgroundAPP",
leader: "test",
desc: "test proj",
},
plugins: [
vuePlugin({
vue: Vue,
}),
],
});
Vue3.x
import heimdallr from "@heimdallr-sdk/browser";
import vuePlugin from "@heimdallr-sdk/vue";
import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)
heimdallr({
dsn: {
host: "localhost:8888",
init: "/project/init",
upload: "/log/upload",
},
app: {
name: "playgroundAPP",
leader: "test",
desc: "test proj",
},
plugins: [
vuePlugin({
vue: app,
}),
],
});