์ฐธ๊ณ ๋ก Vue.js์ ๋ํด์ ์ ๋ชจ๋ฆ ๋๋ค.
์๋ฌด๊ฑฐ๋ ๋ง ํด๋ณด๋ ์ค์ด๊ณ ์ณ์ ์ ๋ณด์ธ์ง ์ ๋ ๋ชจ๋ฆ ๋๋ค!
[ ํ ๋ผ์ ๊ฑฐ๋ถ์ด ๊ฒฝ์ฃผ๊ฒ์ ]
[Vue.js] Vue.js๋ฅผ ์ด์ฉํ์ฌ ๊ฐ๋จํ ํ ๋ผ์ ๊ฑฐ๋ถ์ด ๊ฒฝ์ฃผ๊ฒ์ ๋ง๋ค๊ธฐ.
ํ ๋ผ์ ๊ฑฐ๋ถ์ด๊ฒฝ์ฃผ๊ฒ์์๊ฐ๋จํ๊ฒ ๋ง๋ค์ด๋ณด์. 1. ํ๊ฒฝโก WebStrom: HTML ํธ์ง๊ธฐ๊ฐ ํฌํจ๋ ์๋ฐ์คํฌ๋ฆฝํธ IDE(Intergrated Development Environment)๋ก IntelliJ IDEA ํ๋ซํผ ์์ ๊ตฌ์ถ๋์๊ณ ๋น์ฃผ์ผ ์คํ๋์ค๋ ์ด
post-this.tistory.com
1. ํ๋ฉด
๋ค์ํ๊ธฐ ๋ฒํผ์ ๋๋ฅด๋ฉด ์๋ก๊ณ ์นจ์ด ๋์ด ํ ๋ผ์ ๊ฑฐ๋ถ์ด์ ์์น๊ฐ ์ฒ์์ผ๋ก ๋์๊ฐ๋๋ก ํ๋ค.
2. reload
<style> ์ฝ๋
.game-return{
position: absolute;
top: 39%;
left: 10%;
width: 9%;
height: 14%;
transform: rotate(-30deg);
background: rgba(246, 248, 192, 0.75);
border: 5px solid white;
border-radius: 100px;
z-index: 15;
cursor: pointer;
text-align: center;
font-size: 1.2rem;
font-weight: bold;
font-family: Danjo-bold-Regular;
transition: width 2s ease, height 2s ease, background 2s ease, transform 2s ease;
}
๋ฒํผ์ ๋ง๋ค์๋ค!
๋๋ฌด ๋ง์ ํน์ฑ์ด ์์ด์ ๊ฐ๋จํ๊ฒ ์ค๋ช ํด๋ณด์๋ฉด, position: absolute๋ ํ๋ฉด์ ๊ธฐ์ค์ ์์ ํด๋์ค๋ก ๋ง์ถ ๊ฒ์ด๊ณ , top๊ณผ left๋ ๋ฒํผ์ ์์น๋ฅผ ์กฐ์ ํ ๊ฒ์ด๋ค. width์ height๋ก ๋ฒํผ์ ํฌ๊ธฐ๋ฅผ ์ค์ ํ๊ณ transfrom: rotate(-30deg)๋ก ๋ฒํผ์ ๊ธฐ์ธ๊ธฐ๋ฅผ ์ค์ ํ๋ค. background๋ ๋ฐฐ๊ฒฝ์ปฌ๋ฌ, border๋ ํ ๋๋ฆฌ, border-radius๋ ํ ๋๋ฆฌ ๊ฐ๋์ด๋ค. z-index๋ xyz์ค์ z๋ฅผ ๋ปํ๋ฉฐ ์ฌ๋ฌ ์์๋ฅผ ์์์ฌ๋ฆด๋ ๋งจ ์๋ก ๋ณด์ด๊ฒ ํ๊ณ ์ถ์ ๊ฒฝ์ฐ ์ค์ ํ๋ค. text-align์ ๊ธ์๋ฅผ ์ด๋ป๊ฒ ๋ฐฐ์นํ ๊ฑด์ง, font๊ฐ ์์ ๋ถ์ ๊ฒ์ ๊ธ์จ์ฒด๋ฅผ ์ค์ ํ ๊ฒ์ด๋ฉฐ, transition์ผ๋ก ๋ฒํผ์ ํจ๊ณผ๋ฅผ ์ค์ ํ๋ค.
<button class="game-return" @click="reload"> ๋ค์ํ๊ธฐ </button>
ํด๋ฆญ์ ํ๋ฉด reload ๋ฉ์๋๋ก ์ฐ๊ฒฐ๋๋๋ก ํ๋ค.
<script> ์ฝ๋
export default {
name: 'GameView',
methods: {
reload() {
window.location.reload(true);
}
}
}
window.location.reload(true);๋ฅผ ๋ฃ์ผ๋ฉด ๋ค์ํ๊ธฐ ๋ฒํผ์ ๋๋ฅผ ๋๋ง๋ค ์๋ก๊ณ ์นจ์ด ์คํ๋๋ค.
์๋์ ์ถ์ฒ๋ฅผ ๋จ๊ฒจ๋๊ฒ ์ต๋๋ค.
๋ธ๋ก๊ทธ์ ์ ๊ฐ ์ต๋ํ ์ดํดํ ๋ด์ฉ๊น์ง๋ง ์ ๋๊ฑฐ๋ผ
์ถ์ฒ์ ๋ค์ด๊ฐ์๋ฉด ๋ ๋ง์ ๋ด์ฉ์ด ์์ด ๊ณต๋ถํ์๋๋ฐ ๋์๋์ค๊ฒ๋๋ค.
๐ชฝ
ํ๋ฆฐ ๋ด์ฉ์ด ์๋ค๋ฉด ๋๊ธ๋ก ์๋ ค์ฃผ์ธ์
[vue.js] ํ์ด์ง ๋ฆฌ๋ก๋ ํ๋ ๋ฒ
window.location.reload(true); ์ด๊ฒํ๋ฉด ๋๋ค !!!!
jainn.tistory.com
'๐ป ํ๋ก์ ํธ > ๐ฐํ ๋ผ์ ๊ฑฐ๋ถ์ด ๊ฒฝ์ฃผ๊ฒ์๐ข' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Vue.js] animation๊ณผ @keyframs๋ก ํ ๋ผ์ ๊ฑฐ๋ถ์ด ๊ฒฝ์ฃผ๊ฒ์ ๋ง๋ค๊ธฐ. (8) | 2025.08.12 |
---|---|
[Vue.js] Vue.js๋ฅผ ์ด์ฉํ์ฌ ๊ฐ๋จํ ํ ๋ผ์ ๊ฑฐ๋ถ์ด ๊ฒฝ์ฃผ๊ฒ์ ๋ง๋ค๊ธฐ. (6) | 2025.08.11 |