エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Vuejs3 <script setup> 構文 トップに戻るボタン - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Vuejs3 <script setup> 構文 トップに戻るボタン - Qiita
<template> <transition name="opacity"> <button v-show="buttonActive" @click="pageTop" class="fixe... <template> <transition name="opacity"> <button v-show="buttonActive" @click="pageTop" class="fixed right-3 bottom-3 text-white bg-teal-500 w-20 h-20 rounded-full" > トップに戻る </button> </transition> </template> <script setup> import { onMounted, ref } from 'vue' const buttonActive = ref(false) let scroll = 0 const pageTop = () => { window.scrollTo({ top: 0, behavior: 'smooth' }) } const scrollWindow