html文件中使用vue3+element-plus开发模版

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue3</title>
    <style>
      [v-cloak] {
        display: none !important;
      }
    </style>
    <!--  引入的vu3版本  -->
    <script src="https://unpkg.com/vue@next"></script>
    <!-- import CSS -->
    <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css" />
    <!-- import JavaScript -->
    <script src="https://unpkg.com/element-plus"></script>
  </head>
  <body>
    <div id="app" v-cloak>
      <el-row class="mb-4">
        <el-button>Default</el-button>
        <el-button type="primary">Primary</el-button>
        <el-button type="success">Success</el-button>
        <el-button type="info">Info</el-button>
        <el-button type="warning">Warning</el-button>
        <el-button type="danger">Danger</el-button>
      </el-row>
    </div>

    <script>
      const { createApp, reactive, toRefs, ref, onMounted } = Vue;

      const app = createApp({
        setup() {
          const state = reactive({
            number: "",
            jyPassword: "",
            password: "",
          });
         return {
            ...toRefs(state),
          };
        },
      });
      app.use(ElementPlus);
      app.mount("#app");
    </script>
  </body>
</html>

 

posted @ 2023-04-27 13:08  茶记忆  阅读(670)  评论(0编辑  收藏  举报