[精讚] [會員登入]
488

vue js 與teleport

vue js 與 teleport 範例 <!DOCTYPE html> <html> <

分享此文連結 //n.sfs.tw/16488

分享連結 vue js 與teleport @igogo
(文章歡迎轉載,務必尊重版權註明連結來源)
最後編修
2025-02-21 13:40:28 By igogo
 

 

vue js 與 teleport 範例

 

<!DOCTYPE html>
<html>
<head>
  <title>Vue.js Teleport Hello World</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@3"></script>
</head>
<body>
  <div id="app">
    <button @click="showModal = true">顯示</button>
    <teleport to="body">
      <div v-if="showModal" class="modal">
        <h2>show modal!</h2>
        <button @click="showModal = false">關閉</button>
      </div>
    </teleport>
    

    
    <div id="message">
    </div>
  </div>

  <script>
    const { createApp } = Vue;

    createApp({
      data() {
        return {
          showModal: false
        }
      }
    }).mount('#app');
  </script>

  <style>
    .modal {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: white;
      padding: 20px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
  </style>
</body>
</html>

 

END

你可能感興趣的文章

vue js 與teleport vue js 與 teleport 範例 <!DOCTYPE html> <html> <

[vue.js] input event Form-Input-Components-using-Custom-Events

[javascript] 將角色物件放到清單中,並依序讀出每個角色的X值 參考在scratch中建立三個角色並且給定值 http://n.sfs.tw/content/index/14716 一

word題目轉google測驗 word題目轉google測驗

題庫批次匯入google表單 請先建一新試算表, 將題目轉成格式如下 並將網址列記下來, 後續的題目就是從此試算表讀出 題目 答案 選項一 選項二 選

vue.js components 多個組件的呈現 vue.js 組件 component

隨機好文

vue.js components 多個組件的呈現 vue.js 組件 component

axios vuejs application/x-www-form-urlencoded 送資料 VUE.JS 以 application/x-www-form-urlencoded 送資料

資料表更改為多個primary key, MariaDB [database]> describe TABLENAME; 想由本來是兩個PRIMARY KE

00-F2 的 IPV6 反解設定 近日, 強者我的大神同事, line 傳來一句: igogo 上次你那個ipv6的設定檔 再幫我跑一次 如連結 程式都寫

vim 特定範圍行數開頭加上# 註解 vim 特定範圍行數開頭加上# 註解