boriskaui2.0
v1.0.0
Published
Boriska跨端UI组件库案例
Downloads
2
Readme
Demo, FormItem, GeneralAdd, QRCode
QRCode
需在根目录引入官方jdk
<script src="https://wwcdn.weixin.qq.com/node/wework/wwopen/js/wwLogin-1.2.5.js"></script>
vite.config.ts配置
组件使用前缀
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
// 将所有包含短横线的标签作为自定义元素处理
isCustomElement: (tag) => tag.includes("jw-"),
},
},
}),
],
});
使用案例eg:
<template>
<div><h1>首页</h1></div>
<demo></demo>
<jw-qrcode_login></jw-qrcode_login>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import demo from "../../lib/Demo/demo.vue";
import { QRCode } from "./boriskaui2.esm.js";
const initHandler = async () => {
const res = await customElements.get("QrCode_login");
return res;
};
initHandler().then(() => {
customElements.define("jw-qrcode_login", QRCode);
});
</script>
<style scoped lang="less"></style>