diff options
| author | fuyu <54523771+mfmfuyu@users.noreply.github.com> | 2020-02-05 07:54:49 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-05 07:54:49 +0900 |
| commit | 8e21458e16088fcb8fc58aae638c9ee5309bc65f (patch) | |
| tree | 834f8cef22e69f4fd259d1b9ff41c6d40f982a17 /src | |
| parent | Fix #5798 (#5816) (diff) | |
| download | misskey-8e21458e16088fcb8fc58aae638c9ee5309bc65f.tar.gz misskey-8e21458e16088fcb8fc58aae638c9ee5309bc65f.tar.bz2 misskey-8e21458e16088fcb8fc58aae638c9ee5309bc65f.zip | |
コンポーネントの活性時に再計算するように (#5829)
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/directives/size.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/directives/size.ts b/src/client/directives/size.ts index c7d797e5ae..7c4254566c 100644 --- a/src/client/directives/size.ts +++ b/src/client/directives/size.ts @@ -1,5 +1,5 @@ export default { - inserted(el, binding) { + inserted(el, binding, vn) { const query = binding.value; /* @@ -31,7 +31,7 @@ export default { const calc = () => { const width = el.clientWidth; - + for (const q of query) { if (q.max) { if (width <= q.max) { @@ -55,6 +55,7 @@ export default { el._sizeResizeCb_ = calc; window.addEventListener('resize', calc); + vn.context.$on('hook:activated', calc); }, unbind(el, binding, vn) { |