1.2.9 • Published 9 months ago
@myetherwallet/vue-common-components v1.2.9
Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup>
SFCs, check out the script setup docs to learn more.
Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.
COMPONENTS
- vue header and vue footer
- header as web component. Make sure to install vue and vue router when used. Use currUrl prop to pass current page url.
//in main.js
import { registerMewHeader, MewHeaderWebComponent } from '@myetherwallet/vue-common-components'
// Register MEW header and add event listner on consent change
registerMewHeader()
const MEWHeader = new MewHeaderWebComponent({
currProject: "MEW_BLOG",
bgVisible: true,
userConsent: window.userConsent,
amplitude: window.amplitude,
currUrl: window.location.href
})
document.body.appendChild(MEWHeader)
// Add event listeners
const MEWHeaderShadow = document.querySelector("mew-header-web-component")
MEWHeaderShadow.addEventListener('update:consent', window.handleOptActionConsentChnage)
// Add to window object if you want to change component props
window.MEWHeader = MEWHeader
How to test this in another project
- Build and Pack the library
yarn build
yarn pack
- Copy generated {x}.tgz file path
- install it in another prokect. IE in landing page project:
pnpm install {x}.tgz
1.2.9
9 months ago
1.2.8
9 months ago
1.2.7
9 months ago
1.2.6
9 months ago
1.2.5
9 months ago
1.2.4
10 months ago
1.2.3
10 months ago
1.2.2
11 months ago
1.2.0
11 months ago
1.2.1
11 months ago
1.1.5
11 months ago
1.1.4
12 months ago
1.1.3
12 months ago
1.1.2
12 months ago
1.1.1
12 months ago
1.1.0
12 months ago
1.0.0
12 months ago
0.0.3
1 year ago
0.0.2
1 year ago