[精讚] [會員登入]
167

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] 動態的props 做parent-child components 雙向綁定 vue.js props components camel-case

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

javascript 陣列 javascript 陣列可以放各种型別的元素 let data = [1,2,"john",tru

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

將google試算表當作簡易資料庫,利用Google apps cript 在網頁上操作查詢 將google試算表當作簡易資料庫,利用apps cript 在網頁上操作查詢 若我有一試算表資料 縣市 status

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

我有話要說

>>

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

訪客留言

[無留言]

隨機好文

Arrays.asList 後想再add出現 UnsupportedOperationException 這個問題真是搞死我了 List<String> fruits = Arrays.asList("a

Spring Boot Maven wrappers maven, mvnw, build command

[web]空氣品質嵌入頁面語法 空氣品質, aqi, ajax

[web] 自訂模組-打字機與跑馬燈效果 自訂模組-打字機效果

如何檢查網站憑證是否過期 檢查網站憑證