[精讚] [會員登入]
67

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

你可能感興趣的文章

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

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

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

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

[vue.js] 動態的props 做parent-child components 雙向綁定 vue.js props components camel-case

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

我有話要說

>>

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

訪客留言

[無留言]

隨機好文

download a file from spring boot controllers ownload a file from spring boot controllers

利用maven建立一個可執行的jar檔 利用maven建立一個可執行的jar檔

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

編碼的順序 utf8 big5

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