[精讚] [會員登入]
106

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

你可能感興趣的文章

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

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

vue.js component 在parent與child 傳值 component 在parent與child 傳值

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

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

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

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

centos 7 移机出現 dracut-initqueue timeout centos 7 移机出現 dracut-initqueue timeout 處理

vue.js modal 作兩個選項按鈕並導向不同頁面 vue.js modal 作兩個選項按鈕

vue.js component 在parent與child 傳值 component 在parent與child 傳值

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

proxmox lxc 救援 今天突然接到一名強者我朋友的臨時求援 他說他把pve 從5.1升到5.2後, kvm的虛擬机器都沒問題 , 但是lxc的