little: 未做更改
This commit is contained in:
parent
7294244d7d
commit
324a241319
@ -3,13 +3,10 @@ import { Directive } from "vue";
|
||||
const custom: Directive = {
|
||||
mounted(el, binding, vnode) {
|
||||
el.__onClick__ = () => {
|
||||
binding.value(vnode.props);
|
||||
let { goodsId, event } = binding.value;
|
||||
event(goodsId);
|
||||
};
|
||||
el.addEventListener("click", el.__onClick__);
|
||||
},
|
||||
beforeUnmount(el) {
|
||||
// 解绑dom上的点击事件
|
||||
el.removeEventListener("click", el.__onClick__);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ export const useThemeConfig = defineStore("theme-config", {
|
||||
isBreadcrumb: true, // 面包屑渲染
|
||||
isTabs: true, // 标签栏渲染
|
||||
isFooter: true, // 页脚渲染
|
||||
watermark: "SnowAdmin", // 水印
|
||||
watermark: "", // 水印
|
||||
watermarkStyle: {
|
||||
fontSize: 12,
|
||||
color: "rgba(0, 0, 0, 0.15)"
|
||||
|
||||
@ -1,18 +1,26 @@
|
||||
<template>
|
||||
<div class="dc-page">
|
||||
<button v-custom="getFun" :goodsId="goodsId">文字变色</button>
|
||||
测试指令
|
||||
<!-- <button v-custom="{ goodsId, event: getFun }" :rowData="goodsId">文字变色</button> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const goodsId = ref(100);
|
||||
setTimeout(() => {
|
||||
goodsId.value = 200;
|
||||
}, 1000);
|
||||
// const goodsId = ref(100);
|
||||
// setTimeout(() => {
|
||||
// goodsId.value = 200;
|
||||
// }, 1000);
|
||||
|
||||
const getFun = (e: any) => {
|
||||
console.log("点击事件", e);
|
||||
};
|
||||
// setTimeout(() => {
|
||||
// goodsId.value = 300;
|
||||
// }, 3000);
|
||||
|
||||
// setTimeout(() => {
|
||||
// goodsId.value = 400;
|
||||
// }, 4000);
|
||||
// const getFun = (e: any) => {
|
||||
// console.log("点击事件", e);
|
||||
// };
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user