mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 05:03:08 +02:00
コンポーネントの活性時に再計算するように (#5829)
This commit is contained in:
parent
aade954dd7
commit
8e21458e16
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
inserted(el, binding) {
|
inserted(el, binding, vn) {
|
||||||
const query = binding.value;
|
const query = binding.value;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -31,7 +31,7 @@ export default {
|
||||||
|
|
||||||
const calc = () => {
|
const calc = () => {
|
||||||
const width = el.clientWidth;
|
const width = el.clientWidth;
|
||||||
|
|
||||||
for (const q of query) {
|
for (const q of query) {
|
||||||
if (q.max) {
|
if (q.max) {
|
||||||
if (width <= q.max) {
|
if (width <= q.max) {
|
||||||
|
@ -55,6 +55,7 @@ export default {
|
||||||
el._sizeResizeCb_ = calc;
|
el._sizeResizeCb_ = calc;
|
||||||
|
|
||||||
window.addEventListener('resize', calc);
|
window.addEventListener('resize', calc);
|
||||||
|
vn.context.$on('hook:activated', calc);
|
||||||
},
|
},
|
||||||
|
|
||||||
unbind(el, binding, vn) {
|
unbind(el, binding, vn) {
|
||||||
|
|
Loading…
Reference in a new issue