mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-11-29 18:28:09 +08:00
fix: v-access指令无法控制元素展示隐藏 (#252)
Co-authored-by: cwsong4 <cwsong4@iflytek.com>
This commit is contained in:
parent
df36be4671
commit
11c392d3d1
@ -13,7 +13,10 @@ export default function createDirective(useAccess) {
|
||||
beforeMount(el) {
|
||||
const ctx = {};
|
||||
ctx.watch = (path) => {
|
||||
el._display = el._display || el.style.display;
|
||||
// el._display = el._display || el.style.display; // 这种只能获取到行内样式 会导致保存不了组件加载时的初始display
|
||||
if (!el._display) {
|
||||
el._display = window.getComputedStyle(el).display
|
||||
}
|
||||
const access = useAccess(path);
|
||||
setDisplay(el, access);
|
||||
return watch(access, () => {
|
||||
|
Loading…
Reference in New Issue
Block a user